Class: Sinclair::MethodDefinition::CallDefinition Private
- Inherits:
-
Sinclair::MethodDefinition
- Object
- Sinclair::MethodDefinition
- Sinclair::MethodDefinition::CallDefinition
- Defined in:
- lib/sinclair/method_definition/call_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.
Define a call of method to e done within the class
Constant Summary
Constants inherited from Sinclair::MethodDefinition
Instance Attribute Summary
Attributes inherited from Sinclair::MethodDefinition
Attributes included from OptionsParser
Instance Method Summary collapse
-
#build(klass, type) ⇒ Symbol
private
Builds the method defined.
-
#code_block ⇒ Proc
private
Block to be evaluated by the class when adding methods.
-
#initialize(method_name, *arguments) ⇒ CallDefinition
constructor
private
A new instance of CallDefinition.
Methods inherited from Sinclair::MethodDefinition
build_with, default_value, for, from
Methods included from OptionsParser
Constructor Details
#initialize(method_name, *arguments) ⇒ CallDefinition
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 CallDefinition.
15 16 17 18 |
# File 'lib/sinclair/method_definition/call_definition.rb', line 15 def initialize(method_name, *arguments) @arguments = arguments super(method_name) end |
Instance Method Details
#build(klass, type) ⇒ 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.
Builds the method defined
The method is built using Sinclair::MethodBuilder::CallMethodBuilder
10 |
# File 'lib/sinclair/method_definition/call_definition.rb', line 10 build_with MethodBuilder::CallMethodBuilder |
#code_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.
Block to be evaluated by the class when adding methods
The block will be a call from method_name
passing arguments
as arguments
28 29 30 31 32 33 34 35 |
# File 'lib/sinclair/method_definition/call_definition.rb', line 28 def code_block method_name = name args = arguments proc do send(method_name, *args) end end |