Class: JMESPath::Nodes::ObjectProjection Private

Inherits:
Projection show all
Defined in:
lib/jmespath/nodes/projection.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

FastObjectProjection

Instance Method Summary collapse

Methods inherited from Projection

#initialize, #optimize, #visit

Methods inherited from Node

#chains_with?, #optimize, #visit

Constructor Details

This class inherits a constructor from JMESPath::Nodes::Projection

Instance Method Details

#extract_targets(target) ⇒ 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.



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

def extract_targets(target)
  if target.respond_to?(:to_hash)
    target.to_hash.values
  elsif target.is_a?(Struct)
    target.values
  end
end

#fast_instanceObject

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.



68
69
70
# File 'lib/jmespath/nodes/projection.rb', line 68

def fast_instance
  FastObjectProjection.new(@target.optimize, @projection.optimize)
end