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
Returns a new instance of IfCompStmtNode.
229 230 231 |
# File 'lib/nodes/stmtnodes.rb', line 229 def initialize(*nodes) @nodes = nodes.flatten end |
Instance Method Details
#evaluate ⇒ Object
233 234 235 236 237 238 239 240 |
# File 'lib/nodes/stmtnodes.rb', line 233 def evaluate @nodes.each do |node| if node.argument.evaluate return node.evaluate end end return nil end |