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
Constant Summary
Constants inherited from Sinclair::MethodDefinition
Instance Attribute Summary
Attributes inherited from Sinclair::MethodDefinition
Attributes included from OptionsParser
Instance Method Summary collapse
-
#initialize(name, **options, &block) ⇒ BlockDefinition
constructor
private
A new instance of BlockDefinition.
-
#method_block ⇒ Proc
private
Returns the block that will be used for method creattion.
Methods inherited from Sinclair::MethodDefinition
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
#method_block ⇒ Proc
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 the block that will be used for method creattion
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/sinclair/method_definition/block_definition.rb', line 26 def method_block return block unless cached? case cached when :full BlockHelper.full_cached_method_proc(name, &block) else BlockHelper.cached_method_proc(name, &block) end end |