Class: JMESPath::Nodes::EqCondition 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

LiteralRightEqCondition

Constant Summary

Constants inherited from ComparatorCondition

ComparatorCondition::COMPARABLE_TYPES, ComparatorCondition::COMPARATOR_TO_CONDITION

Instance Method Summary collapse

Methods inherited from ComparatorCondition

#initialize

Methods inherited from Node

#chains_with?

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.



59
60
61
62
63
64
65
# File 'lib/jmespath/nodes/condition.rb', line 59

def optimize
  if @right.is_a?(Literal)
    LiteralRightEqCondition.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.



55
56
57
# File 'lib/jmespath/nodes/condition.rb', line 55

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