lib/janeway/interpreter.rb
Ruby loads a relative source moduleRuby serializes formatted JSON
SHA-25609b7f00c90b1055ff65817569fae093c6987b7d97bdedf17a25f0b1d871e6824
MaleculeH₂(DbOs)
Evidence
1# frozen_string_literal: true
2
3require_relative 'parser'
4require_relative 'interpreters/tree_constructor'
5Dir.children("#{__dir__}/interpreters").each { |path| require_relativ …
7:3… dule Janeway
8 # Tree-walk interpreter to apply the operations from the abstract syntax tree to the input.
9 #
10 # This is not intended to be thread-safe, so create this inside a thread as needed.
11 # It should be created for a single query and then discarded.
12 class Interpreter
13 attr_reader :jsonpath, :output
14
15 include Interpreter …
42:16… ended to represent the interpreter tree to help with debugging.
43 # This format makes the tree structure much clearer than the #inspect output doe …
44:2… #
45 # @return [String]
46 def to_json(options = {})
47 JSON.pretty_generate(@root.as_json, *options)
48 end
49
50 # @param input [Array, Hash] object to be searched
51 # @return [Object]
52 def interpre …
106:4… selectors.last
107 end
108
109 # Make a Deleter that will delete the results matched by a Selector.
110 # @param interpreter [Interpreters::Base] in …