Class: Doodle::DeferredBlock
- Inherits:
-
Object
- Object
- Doodle::DeferredBlock
- Defined in:
- lib/doodle/deferred.rb
Overview
save a block for later execution
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
Instance Method Summary collapse
- #call(*a, &b) ⇒ Object
-
#initialize(arg_block = nil, &block) ⇒ DeferredBlock
constructor
A new instance of DeferredBlock.
Constructor Details
#initialize(arg_block = nil, &block) ⇒ DeferredBlock
Returns a new instance of DeferredBlock.
5 6 7 8 |
# File 'lib/doodle/deferred.rb', line 5 def initialize(arg_block = nil, &block) arg_block = block if block_given? @block = arg_block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
4 5 6 |
# File 'lib/doodle/deferred.rb', line 4 def block @block end |
Instance Method Details
#call(*a, &b) ⇒ Object
9 10 11 |
# File 'lib/doodle/deferred.rb', line 9 def call(*a, &b) block.call(*a, &b) end |