Class: Zaid::Nodes::CallNode
- Inherits:
-
Struct
- Object
- Struct
- Zaid::Nodes::CallNode
- Defined in:
- lib/zaid/nodes/call_node.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#method_name ⇒ Object
Returns the value of attribute method_name.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
Instance Method Summary collapse
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments
5 6 7 |
# File 'lib/zaid/nodes/call_node.rb', line 5 def arguments @arguments end |
#method_name ⇒ Object
Returns the value of attribute method_name
5 6 7 |
# File 'lib/zaid/nodes/call_node.rb', line 5 def method_name @method_name end |
#receiver ⇒ Object
Returns the value of attribute receiver
5 6 7 |
# File 'lib/zaid/nodes/call_node.rb', line 5 def receiver @receiver end |
Instance Method Details
#eval(context) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/zaid/nodes/call_node.rb', line 6 def eval(context) value = if receiver receiver.eval(context) else context.current_self end value.call(method_name, arguments.map { |argument| argument.eval(context) }) end |