Class: JMESPath::Nodes::Not Private

Inherits:
Node
  • Object
show all
Defined in:
lib/jmespath/nodes/not.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods inherited from Node

#chains_with?

Constructor Details

#initialize(expression) ⇒ Not

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Not.



5
6
7
# File 'lib/jmespath/nodes/not.rb', line 5

def initialize(expression)
  @expression = expression
end

Instance Method Details

#optimizeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



13
14
15
# File 'lib/jmespath/nodes/not.rb', line 13

def optimize
  self.class.new(@expression.optimize)
end

#visit(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/jmespath/nodes/not.rb', line 9

def visit(value)
  JMESPath::Util.falsey?(@expression.visit(value))
end