Class: WhileLoopNode
Overview
Loop Nodes
Instance Attribute Summary collapse
-
#condition ⇒ Object
Returns the value of attribute condition.
Attributes inherited from Node
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(condition, statement) ⇒ WhileLoopNode
constructor
A new instance of WhileLoopNode.
Methods inherited from Node
Constructor Details
#initialize(condition, statement) ⇒ WhileLoopNode
Returns a new instance of WhileLoopNode.
161 162 163 164 |
# File 'lib/nodes/stmtnodes.rb', line 161 def initialize(condition, statement) @condition = condition super(statement) end |
Instance Attribute Details
#condition ⇒ Object
Returns the value of attribute condition.
159 160 161 |
# File 'lib/nodes/stmtnodes.rb', line 159 def condition @condition end |
Instance Method Details
#evaluate ⇒ Object
166 167 168 169 170 171 |
# File 'lib/nodes/stmtnodes.rb', line 166 def evaluate while @condition.evaluate @value.evaluate end self.class end |