Class: Luoma::SubExpression
- Inherits:
-
InfixExpression
- Object
- Expression
- InfixExpression
- Luoma::SubExpression
- 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
566 567 568 569 570 |
# File 'lib/luoma/expression.rb', line 566 def evaluate(context) left = context.env.to_numeric(@left.evaluate(context), context, default: :nothing) right = context.env.to_numeric(@right.evaluate(context), context, default: :nothing) left == :nothing || right == :nothing ? :nothing : left - right # steep:ignore end |
#to_s ⇒ Object
573 574 575 |
# File 'lib/luoma/expression.rb', line 573 def to_s "#{@left} - #{@right}" end |