Class: Zaid::Nodes::SetLocalNode
- Inherits:
-
Struct
- Object
- Struct
- Zaid::Nodes::SetLocalNode
- Defined in:
- lib/zaid/nodes/set_local_node.rb
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
5 6 7 |
# File 'lib/zaid/nodes/set_local_node.rb', line 5 def name @name end |
#value ⇒ Object
Returns the value of attribute value
5 6 7 |
# File 'lib/zaid/nodes/set_local_node.rb', line 5 def value @value end |
Instance Method Details
#eval(context) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/zaid/nodes/set_local_node.rb', line 6 def eval(context) if Constants.key?(name) Constants[name] = value.eval(context) else context.locals[name] = value.eval(context) end end |