Class: JMESPath::Runtime Private
- Inherits:
-
Object
- Object
- JMESPath::Runtime
- Defined in:
- lib/jmespath/runtime.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- CACHE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{}
- MUTEX =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Mutex.new
Class Method Summary collapse
- .clear_cache ⇒ Object private
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Runtime
constructor
private
A new instance of Runtime.
- #search(expression, data) ⇒ Mixed? private
Constructor Details
#initialize(options = {}) ⇒ Runtime
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Runtime.
14 15 16 17 |
# File 'lib/jmespath/runtime.rb', line 14 def initialize( = {}) @parser = [:parser] || Parser.new @interpreter = [:interpreter] || TreeInterpreter.new end |
Class Method Details
.clear_cache ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/jmespath/runtime.rb', line 39 def clear_cache MUTEX.synchronize { CACHE.clear } end |
Instance Method Details
#search(expression, data) ⇒ Mixed?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'lib/jmespath/runtime.rb', line 22 def search(expression, data) @interpreter.visit(parse(expression), data) end |