Class: Luoma::CoalesceExpression
- Inherits:
-
InfixExpression
- Object
- Expression
- InfixExpression
- Luoma::CoalesceExpression
- 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
413 414 415 416 |
# File 'lib/luoma/expression.rb', line 413 def evaluate(context) left = @left.evaluate(context) context.env.nothing?(left) ? @right.evaluate(context) : left end |
#to_s ⇒ Object
419 420 421 |
# File 'lib/luoma/expression.rb', line 419 def to_s "#{@left} orElse #{@right}" end |