Class: Luoma::OrExpression
- Inherits:
-
InfixExpression
- Object
- Expression
- InfixExpression
- Luoma::OrExpression
- Defined in:
- lib/luoma/expression.rb,
sig/luoma/expression.rbs
Instance Attribute Summary
Attributes inherited from Expression
Instance Method Summary collapse
Methods inherited from InfixExpression
Methods inherited from Expression
#children, #initialize, #scope
Constructor Details
This class inherits a constructor from Luoma::InfixExpression
Instance Method Details
#evaluate(context) ⇒ Object
426 427 428 429 |
# File 'lib/luoma/expression.rb', line 426 def evaluate(context) left = @left.evaluate(context) context.env.truthy?(left, context) ? left : @right.evaluate(context) end |
#to_s ⇒ Object
432 433 434 |
# File 'lib/luoma/expression.rb', line 432 def to_s "#{@left} or #{@right}" end |