Method: Janeway::Enumerator#each

Defined in:
lib/janeway/enumerator.rb

#each {|value, parent, hash, normalized| ... } ⇒ void

This method returns an undefined value.

Iterate through each value matched by the JSONPath query.

Yield Parameters:

  • value (Object)

    matched by query

  • parent (Array, Hash)

    object that contains the value

  • hash (String, Integer)

    key or array index of the value within the parent object

  • normalized (String)

    jsonpath that uniqely points to this value



37
38
39
40
41
# File 'lib/janeway/enumerator.rb', line 37

def each(&block)
  return enum_for(:each) unless block_given?

  Janeway::Interpreter.new(@query, as: :iterator, &block).interpret(@input)
end