Class: Luoma::LeExpression

Inherits:
InfixExpression show all
Defined in:
lib/luoma/expression.rb,
sig/luoma/expression.rbs

Instance Attribute Summary

Attributes inherited from Expression

#span, #token

Instance Method Summary collapse

Methods inherited from InfixExpression

#children, #initialize

Methods inherited from Expression

#children, #initialize, #scope

Constructor Details

This class inherits a constructor from Luoma::InfixExpression

Instance Method Details

#evaluate(context) ⇒ Object

Signature:

  • (RenderContext) -> untyped



488
489
490
491
492
# File 'lib/luoma/expression.rb', line 488

def evaluate(context)
  left = @left.evaluate(context)
  right = @right.evaluate(context)
  context.env.lt?(left, right, context, @span) || context.env.eq?(left, right, context, @span)
end

#to_sObject

Signature:

  • () -> String



495
496
497
# File 'lib/luoma/expression.rb', line 495

def to_s
  "#{@left} <= #{@right}"
end