Class: Janeway::Interpreters::RootNodeDeleter
- Inherits:
-
RootNodeInterpreter
- Object
- Base
- RootNodeInterpreter
- Janeway::Interpreters::RootNodeDeleter
- Defined in:
- lib/janeway/interpreters/root_node_deleter.rb,
lib/janeway/interpreters/root_node_delete_if.rb
Overview
Interprets the root node for deletion
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#interpret(_input, _parent, root, _path) ⇒ Array
Delete all values from the root node.
Methods inherited from Base
#as_json, #initialize, #selector, #to_s, #type
Constructor Details
This class inherits a constructor from Janeway::Interpreters::Base
Instance Method Details
#interpret(_input, _parent, root, _path) ⇒ Array
Delete all values from the root node.
TODO: unclear, for deletion is there a difference between queries ‘$’ and ‘$.*’?
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/janeway/interpreters/root_node_deleter.rb', line 18 def interpret(_input, _parent, root, _path) case root when Array results = root.dup root.clear results when Hash results = root.values root.clear results else [] end end |