class JMESPath::Nodes::Projection

Public Class Methods

new(target, projection) click to toggle source
# File lib/jmespath/nodes/projection.rb, line 6
def initialize(target, projection)
  @target = target
  @projection = projection
end

Public Instance Methods

optimize() click to toggle source
# File lib/jmespath/nodes/projection.rb, line 22
def optimize
  if @projection.is_a?(Current)
    fast_instance
  else
    self.class.new(@target.optimize, @projection.optimize)
  end
end
visit(value) click to toggle source
# File lib/jmespath/nodes/projection.rb, line 11
def visit(value)
  if (targets = extract_targets(@target.visit(value)))
    list = []
    targets.each do |v|
      vv = @projection.visit(v)
      list << vv unless vv.nil?
    end
    list
  end
end

Private Instance Methods

extract_targets(_left_value) click to toggle source
# File lib/jmespath/nodes/projection.rb, line 32
def extract_targets(_left_value)
  nil
end