Class: Luoma::AndExpression

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



439
440
441
442
# File 'lib/luoma/expression.rb', line 439

def evaluate(context)
  left = @left.evaluate(context)
  context.env.truthy?(left, context) ? @right.evaluate(context) : left
end

#to_sObject

Signature:

  • () -> String



445
446
447
# File 'lib/luoma/expression.rb', line 445

def to_s
  "#{@left} and #{@right}"
end