Class: SetConstantNode
- Inherits:
-
Struct
- Object
- Struct
- SetConstantNode
- Defined in:
- lib/nodes.rb,
lib/interpreter.rb
Overview
Setting the value of a constant.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
43 44 45 |
# File 'lib/nodes.rb', line 43 def name @name end |
#value ⇒ Object
Returns the value of attribute value
43 44 45 |
# File 'lib/nodes.rb', line 43 def value @value end |
Instance Method Details
#eval(context) ⇒ Object
92 93 94 |
# File 'lib/interpreter.rb', line 92 def eval(context) context[name] = value.eval(context) end |