Class: JMESPath::Nodes::NeqCondition Private

Inherits:
ComparatorCondition show all
Defined in:
lib/jmespath/nodes/condition.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.

Direct Known Subclasses

LiteralRightNeqCondition

Constant Summary

Constants inherited from ComparatorCondition

ComparatorCondition::COMPARATOR_TO_CONDITION

Instance Method Summary collapse

Methods inherited from ComparatorCondition

#initialize

Methods inherited from Node

#chains_with?, #hash_like?

Constructor Details

This class inherits a constructor from JMESPath::Nodes::ComparatorCondition

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.



76
77
78
79
80
81
82
# File 'lib/jmespath/nodes/condition.rb', line 76

def optimize
  if @right.is_a?(Literal)
    LiteralRightNeqCondition.new(@left, @right, @child)
  else
    self
  end
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.



72
73
74
# File 'lib/jmespath/nodes/condition.rb', line 72

def visit(value)
  @left.visit(value) != @right.visit(value) ? @child.visit(value) : nil
end