Sha256: a2cbb1564c7dcfb08e015b150775e93ef7ff167dd866f1dc57f74f1eb9a1ccfd

Contents?: true

Size: 274 Bytes

Versions: 3

Compression:

Stored size: 274 Bytes

Contents

module JMESPath
  # @api private
  module Nodes
    class Index < Field
      def initialize(index)
        super(index)
      end

      def visit(value)
        if value.is_a?(Array)
          value[@key]
        else
          nil
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
burtpath-1.1.2 lib/jmespath/nodes/index.rb
burtpath-1.1.1 lib/jmespath/nodes/index.rb
burtpath-1.1.0 lib/jmespath/nodes/index.rb