Class: Sinclair::MethodDefinition::BlockDefinition Abstract Private
- Inherits:
-
Sinclair::MethodDefinition
- Object
- Sinclair::MethodDefinition
- Sinclair::MethodDefinition::BlockDefinition
- Defined in:
- lib/sinclair/method_definition/block_definition.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
This class is abstract.
Define a method from block
Direct Known Subclasses
Constant Summary
Constants inherited from Sinclair::MethodDefinition
Instance Attribute Summary
Attributes included from OptionsParser
Instance Method Summary collapse
-
#build(klass) ⇒ Symbol
private
Adds the instance method to given klass.
-
#initialize(name, **options, &block) ⇒ BlockDefinition
constructor
private
A new instance of BlockDefinition.
Methods included from OptionsParser
Constructor Details
#initialize(name, **options, &block) ⇒ BlockDefinition
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of BlockDefinition.
15 16 17 18 |
# File 'lib/sinclair/method_definition/block_definition.rb', line 15 def initialize(name, **, &block) @block = block super(name, **) end |
Instance Method Details
#build(klass) ⇒ Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Adds the instance method to given klass
70 71 72 |
# File 'lib/sinclair/method_definition/block_definition.rb', line 70 def build(klass) klass.send(method_definer, name, method_block) end |