class JMESPath::Nodes::Projection
Public Class Methods
new(target, projection)
click to toggle source
# File lib/jmespath/nodes/projection.rb, line 5 def initialize(target, projection) @target = target @projection = projection end
Public Instance Methods
optimize()
click to toggle source
# File lib/jmespath/nodes/projection.rb, line 23 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 10 def visit(value) if (targets = extract_targets(@target.visit(value))) list = [] targets.each do |v| vv = @projection.visit(v) unless vv.nil? list << vv end end list end end
Private Instance Methods
extract_targets(left_value)
click to toggle source
# File lib/jmespath/nodes/projection.rb, line 33 def extract_targets(left_value) nil end