Class: CallNode
- Inherits:
-
Struct
- Object
- Struct
- CallNode
- Defined in:
- lib/turmali/nodes.rb,
lib/turmali/interpreter.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#method ⇒ Object
Returns the value of attribute method.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
Instance Method Summary collapse
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments
32 33 34 |
# File 'lib/turmali/nodes.rb', line 32 def arguments @arguments end |
#method ⇒ Object
Returns the value of attribute method
32 33 34 |
# File 'lib/turmali/nodes.rb', line 32 def method @method end |
#receiver ⇒ Object
Returns the value of attribute receiver
32 33 34 |
# File 'lib/turmali/nodes.rb', line 32 def receiver @receiver end |
Instance Method Details
#eval(context) ⇒ Object
83 84 85 86 87 88 89 90 91 92 |
# File 'lib/turmali/interpreter.rb', line 83 def eval(context) if receiver value = receiver.eval(context) else value = context.current_self end evaluated_arguments = arguments.map { |arg| arg.eval(context) } value.call(method, evaluated_arguments) end |