Class: Janeway::Interpreters::RootNodeInterpreter

Inherits:
Base
  • Object
show all
Defined in:
lib/janeway/interpreters/root_node_interpreter.rb

Overview

Interprets the root identifer, returns results or forwards them to next selector.

This is required at the beginning of every jsonpath query. It may also be used within filter selector expressions.

Constant Summary

Constants inherited from Base

Base::NOTHING

Instance Attribute Summary

Attributes inherited from Base

#next, #node

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Janeway::Interpreters::Base

Instance Method Details

#interpret(_input, root) ⇒ Object

Start an expression chain using the entire, unfiltered input.

Parameters:

  • _input (Array, Hash)

    the results of processing so far

  • root (Array, Hash)

    the entire input



16
17
18
19
20
# File 'lib/janeway/interpreters/root_node_interpreter.rb', line 16

def interpret(_input, root)
  return [root] unless @next

  @next.interpret(root, root)
end