bolt 0.21.3 → 0.21.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of bolt might be problematic. Click here for more details.

@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bolt
4
- module Util
5
- class OnAccess
6
- def initialize(&block)
7
- @constructor = block
8
- @obj = nil
9
- end
10
-
11
- # If a method is called and we haven't constructed the object,
12
- # construct it. Then pass the call to the object.
13
- # rubocop:disable Style/MethodMissingSuper
14
- # rubocop:disable Style/MissingRespondToMissing
15
- def method_missing(method, *args, &block)
16
- if @obj.nil?
17
- @obj = @constructor.call
18
- end
19
-
20
- @obj.send(method, *args, &block)
21
- end
22
- # rubocop:enable Style/MethodMissingSuper
23
- # rubocop:enable Style/MissingRespondToMissing
24
- end
25
- end
26
- end