Class: Liquid2::LogicalNot
- Inherits:
-
Expression
- Object
- Expression
- Liquid2::LogicalNot
- Defined in:
- lib/liquid2/expressions/logical.rb
Overview
A negated expression.
Instance Attribute Summary
Attributes inherited from Expression
Instance Method Summary collapse
- #children ⇒ Object
- #evaluate(context) ⇒ Object
-
#initialize(token, expr) ⇒ LogicalNot
constructor
A new instance of LogicalNot.
Methods inherited from Expression
Constructor Details
#initialize(token, expr) ⇒ LogicalNot
Returns a new instance of LogicalNot.
9 10 11 12 |
# File 'lib/liquid2/expressions/logical.rb', line 9 def initialize(token, expr) super(token) @expr = expr end |
Instance Method Details
#children ⇒ Object
18 |
# File 'lib/liquid2/expressions/logical.rb', line 18 def children = [@expr] |
#evaluate(context) ⇒ Object
14 15 16 |
# File 'lib/liquid2/expressions/logical.rb', line 14 def evaluate(context) !Liquid2.truthy?(context, context.evaluate(@expr)) end |