Class: Luoma::MulExpression
- Inherits:
-
InfixExpression
- Object
- Expression
- InfixExpression
- Luoma::MulExpression
- 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
580 581 582 583 584 |
# File 'lib/luoma/expression.rb', line 580 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
587 588 589 |
# File 'lib/luoma/expression.rb', line 587 def to_s "#{@left} * #{@right}" end |