Class: LogicalNode

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

Overview

Class for logical expressions.

Instance Method Summary collapse

Methods inherited from BinaryexpressionNode

#initialize

Constructor Details

This class inherits a constructor from BinaryexpressionNode

Instance Method Details

#evaluate(scope) ⇒ Object



266
267
268
269
270
# File 'lib/nodes.rb', line 266

def evaluate(scope)

  # Not possible to use send-method since ruby TrueClass/FalseClass has no method for && or ||.
  return eval("#{@lhs.evaluate(scope)}#{@op}#{@rhs.evaluate(scope)}")
end