Class: IfNode

Inherits:
ControlflowNode show all
Defined in:
lib/nodes.rb

Overview

Class for if-statements.

Instance Method Summary collapse

Methods inherited from ControlflowNode

#initialize

Constructor Details

This class inherits a constructor from ControlflowNode

Instance Method Details

#evaluate(scope) ⇒ Object

Evaluate if expression is true, if so evaluate block.



318
319
320
321
322
# File 'lib/nodes.rb', line 318

def evaluate(scope)
  if @expression.evaluate(scope)
    @block.evaluate(scope)
  end
end