Class: JMESPath::Nodes::Index Private
- Defined in:
- lib/jmespath/nodes/index.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.
Instance Method Summary collapse
-
#initialize(index) ⇒ Index
constructor
private
A new instance of Index.
- #visit(value) ⇒ Object private
Methods inherited from Field
Methods inherited from Node
#chains_with?, #hash_like?, #optimize
Constructor Details
#initialize(index) ⇒ Index
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.
Returns a new instance of Index.
5 6 7 |
# File 'lib/jmespath/nodes/index.rb', line 5 def initialize(index) super(index) end |
Instance Method Details
#visit(value) ⇒ 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.
9 10 11 12 13 14 15 |
# File 'lib/jmespath/nodes/index.rb', line 9 def visit(value) if value.is_a?(Array) value[@key] else nil end end |