Class: IfNode
- Inherits:
-
Struct
- Object
- Struct
- IfNode
- Defined in:
- lib/turmali/nodes.rb,
lib/turmali/interpreter.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#condition ⇒ Object
Returns the value of attribute condition.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
46 47 48 |
# File 'lib/turmali/nodes.rb', line 46 def body @body end |
#condition ⇒ Object
Returns the value of attribute condition
46 47 48 |
# File 'lib/turmali/nodes.rb', line 46 def condition @condition end |
Instance Method Details
#eval(context) ⇒ Object
119 120 121 122 123 124 125 |
# File 'lib/turmali/interpreter.rb', line 119 def eval(context) if condition.eval(context).ruby_value body.eval(context) else Constants["nil"] end end |