module Jamespath
def compile(query)
- Example: Compiling an expression -
Other tags:
- See: VM#search -
Returns:
-
(VM)
- a virtual machine object that can interpret the expression.
Parameters:
-
query
(String
) -- the expression to search for.
def compile(query) VM.new(Parser.new.parse(query)) end
def search(query, object)
- Example: Searching an object -
Returns:
-
(nil)
- if no objects matched the expression -
(Object)
- the object, or list of objects, that match the expression.
Parameters:
-
object
(Object
) -- an object to search for the expression in. -
query
(String
) -- the expression to search for.
def search(query, object) compile(query).search(object) end