Class: MethodObject::Base
- Inherits:
-
Object
- Object
- MethodObject::Base
- Defined in:
- lib/method_object/base.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options, block, generator) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(options, block, generator) ⇒ Base
Returns a new instance of Base.
20 21 22 23 24 25 26 |
# File 'lib/method_object/base.rb', line 20 def initialize(, block, generator) .each do |parameter_name, value| instance_variable_set("@#{parameter_name}", value) end return unless generator.block_parameter instance_variable_set("@#{generator.block_name}", block) end |
Class Method Details
.call(options = {}, &block) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/method_object/base.rb', line 5 def call( = {}, &block) new( , block, @generator) .call(*(), &block) end |