Class: Luoma::NotExpression

Inherits:
PrefixExpression 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 PrefixExpression

#children, #initialize

Methods inherited from Expression

#children, #initialize, #scope

Constructor Details

This class inherits a constructor from Luoma::PrefixExpression

Instance Method Details

#evaluate(context) ⇒ Object



364
365
366
# File 'lib/luoma/expression.rb', line 364

def evaluate(context)
  !context.env.truthy?(@right.evaluate(context), context)
end

#to_sObject

Signature:

  • () -> String



369
370
371
# File 'lib/luoma/expression.rb', line 369

def to_s
  "not #{@right}"
end