Class: VariableCallNode
Overview
Variable Nodes
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from Node
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(name) ⇒ VariableCallNode
constructor
A new instance of VariableCallNode.
Methods inherited from Node
Constructor Details
#initialize(name) ⇒ VariableCallNode
Returns a new instance of VariableCallNode.
8 9 10 |
# File 'lib/nodes/stmtnodes.rb', line 8 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/nodes/stmtnodes.rb', line 6 def name @name end |
Instance Method Details
#evaluate ⇒ Object
12 13 14 15 |
# File 'lib/nodes/stmtnodes.rb', line 12 def evaluate @value = ScopeManager.lookup_var(@name) return @value end |