Class: Doodle::DeferredBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/doodle.rb

Overview

save a block for later execution

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arg_block = nil, &block) ⇒ DeferredBlock

Returns a new instance of DeferredBlock.



284
285
286
287
# File 'lib/doodle.rb', line 284

def initialize(arg_block = nil, &block)
  arg_block = block if block_given?
  @block = arg_block
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



283
284
285
# File 'lib/doodle.rb', line 283

def block
  @block
end

Instance Method Details

#call(*a, &b) ⇒ Object



288
289
290
# File 'lib/doodle.rb', line 288

def call(*a, &b)
  block.call(*a, &b)
end