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

Constant Summary collapse

EMPTY_ARRAY =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

[].freeze

Instance Method Summary collapse

Methods inherited from Projection

#initialize, #optimize, #visit

Methods inherited from Node

#chains_with?, #hash_like?, #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.



67
68
69
70
71
72
73
74
75
# File 'lib/jmespath/nodes/projection.rb', line 67

def extract_targets(target)
  if hash_like?(target)
    target.values
  elsif target == EMPTY_ARRAY
    EMPTY_ARRAY
  else
    nil
  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.



77
78
79
# File 'lib/jmespath/nodes/projection.rb', line 77

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