Class: VariableDecNode
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from Node
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(name, value) ⇒ VariableDecNode
constructor
A new instance of VariableDecNode.
Methods inherited from Node
Constructor Details
#initialize(name, value) ⇒ VariableDecNode
Returns a new instance of VariableDecNode.
21 22 23 24 |
# File 'lib/nodes/stmtnodes.rb', line 21 def initialize(name, value) super(value) @name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
19 20 21 |
# File 'lib/nodes/stmtnodes.rb', line 19 def name @name end |
Instance Method Details
#evaluate ⇒ Object
26 27 28 29 |
# File 'lib/nodes/stmtnodes.rb', line 26 def evaluate ScopeManager.add_to_current_scope(name, @value) self end |