Class: IfCompStmtNode
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(*nodes) ⇒ IfCompStmtNode
constructor
A new instance of IfCompStmtNode.
Methods inherited from Node
Constructor Details
#initialize(*nodes) ⇒ IfCompStmtNode
142 143 144 |
# File 'lib/nodes/stmtnodes.rb', line 142 def initialize(*nodes) @nodes = nodes.flatten end |
Instance Method Details
#evaluate ⇒ Object
146 147 148 149 150 151 152 153 |
# File 'lib/nodes/stmtnodes.rb', line 146 def evaluate @nodes.each do |node| if node.argument.evaluate return node.evaluate end end return nil end |