Class: JSONPath::Nodes::RootNode

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/jsonpath/nodes.rb

Instance Method Summary collapse

Instance Method Details

#walk(object) ⇒ Object



6
7
8
9
10
# File 'lib/jsonpath/nodes.rb', line 6

def walk(object)
  selectors.elements.inject([object]) do |reduce, selector|
    selector.descend(*reduce)
  end
end