class JMESPath::Nodes::Comparator

Attributes

left[R]
right[R]

Public Class Methods

create(relation, left, right) click to toggle source
# File lib/jmespath/nodes/comparator.rb, line 12
def self.create(relation, left, right)
  type = begin
    case relation
    when '==' then Comparators::Eq
    when '!=' then Comparators::Neq
    when '>' then Comparators::Gt
    when '>=' then Comparators::Gte
    when '<' then Comparators::Lt
    when '<=' then Comparators::Lte
    end
  end
  type.new(left, right)
end
new(left, right) click to toggle source
# File lib/jmespath/nodes/comparator.rb, line 7
def initialize(left, right)
  @left = left
  @right = right
end

Public Instance Methods

optimize() click to toggle source
# File lib/jmespath/nodes/comparator.rb, line 30
def optimize
  self.class.new(@left.optimize, @right.optimize)
end
visit(value) click to toggle source
# File lib/jmespath/nodes/comparator.rb, line 26
def visit(value)
  check(@left.visit(value), @right.visit(value))
end

Private Instance Methods

check(left_value, right_value) click to toggle source
# File lib/jmespath/nodes/comparator.rb, line 36
def check(left_value, right_value)
  nil
end