Class: JMESPath::Nodes::EqCondition Private

Inherits:
ComparatorCondition show all
Defined in:
lib/jmespath/nodes/condition.rb

Overview

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.

API:

  • private

Direct Known Subclasses

LiteralRightEqCondition

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.

API:

  • private



49
50
51
52
53
54
55
# File 'lib/jmespath/nodes/condition.rb', line 49

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.

API:

  • private



45
46
47
# File 'lib/jmespath/nodes/condition.rb', line 45

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