Class: JsonDataExtractor::SchemaCache
- Inherits:
-
Object
- Object
- JsonDataExtractor::SchemaCache
- Defined in:
- lib/json_data_extractor/schema_cache.rb
Overview
Caches schema elements to avoid re-processing the schema for each data extraction
Instance Attribute Summary collapse
-
#path_cache ⇒ Object
readonly
Returns the value of attribute path_cache.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#schema_elements ⇒ Object
readonly
Returns the value of attribute schema_elements.
Instance Method Summary collapse
-
#initialize(schema) ⇒ SchemaCache
constructor
A new instance of SchemaCache.
Constructor Details
#initialize(schema) ⇒ SchemaCache
Returns a new instance of SchemaCache.
8 9 10 11 12 13 14 15 |
# File 'lib/json_data_extractor/schema_cache.rb', line 8 def initialize(schema) @schema = schema @schema_elements = {} @path_cache = {} # Pre-process the schema to create SchemaElement objects process_schema end |
Instance Attribute Details
#path_cache ⇒ Object (readonly)
Returns the value of attribute path_cache.
6 7 8 |
# File 'lib/json_data_extractor/schema_cache.rb', line 6 def path_cache @path_cache end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
6 7 8 |
# File 'lib/json_data_extractor/schema_cache.rb', line 6 def schema @schema end |
#schema_elements ⇒ Object (readonly)
Returns the value of attribute schema_elements.
6 7 8 |
# File 'lib/json_data_extractor/schema_cache.rb', line 6 def schema_elements @schema_elements end |