Class: JsonDataExtractor::PathCompiler
- Defined in:
- lib/json_data_extractor/path_compiler.rb
Overview
Compiles JSONPath expressions into optimized navigators
Defined Under Namespace
Classes: JsonPathWrapper
Instance Method Summary collapse
Instance Method Details
#compile(path) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/json_data_extractor/path_compiler.rb', line 6 def compile(path) return nil unless path if DirectNavigator.simple_path?(path) DirectNavigator.new(path) else # Fallback to JsonPath for complex expressions JsonPathWrapper.new(path) end end |