Class: Locomotive::Steam::Services::Defer
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Locomotive::Steam::Services::Defer
- Defined in:
- lib/locomotive/steam/services.rb
Instance Method Summary collapse
- #__getobj__ ⇒ Object
-
#initialize(&block) ⇒ Defer
constructor
A new instance of Defer.
- #nil? ⇒ Boolean
Constructor Details
#initialize(&block) ⇒ Defer
Returns a new instance of Defer.
19 20 21 22 |
# File 'lib/locomotive/steam/services.rb', line 19 def initialize(&block) @constructor = block super(nil) end |
Instance Method Details
#__getobj__ ⇒ Object
23 24 25 |
# File 'lib/locomotive/steam/services.rb', line 23 def __getobj__ super || __setobj__(@constructor.call) end |
#nil? ⇒ Boolean
26 27 28 |
# File 'lib/locomotive/steam/services.rb', line 26 def nil? __getobj__.nil? end |