Class: GetConstantNode
- Inherits:
-
Struct
- Object
- Struct
- GetConstantNode
- Defined in:
- lib/toylang/ast/nodes.rb,
lib/toylang/interpreter/evaluation.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
35 36 37 |
# File 'lib/toylang/ast/nodes.rb', line 35 def name @name end |
Instance Method Details
#eval(context) ⇒ Object
51 52 53 |
# File 'lib/toylang/interpreter/evaluation.rb', line 51 def eval(context) context[name] end |