Class: JsonDataExtractor::SchemaAnalyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/json_data_extractor/schema_analyzer.rb

Overview

Analyzes schema and creates optimized extraction plan

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema, modifiers = {}) ⇒ SchemaAnalyzer

Returns a new instance of SchemaAnalyzer.



9
10
11
12
13
14
15
16
17
# File 'lib/json_data_extractor/schema_analyzer.rb', line 9

def initialize(schema, modifiers = {})
  @schema = schema
  @modifiers = modifiers
  @path_compiler = PathCompiler.new
  @extraction_plan = []
  @result_template = {}

  analyze_schema
end

Instance Attribute Details

#extraction_planObject (readonly)

Returns the value of attribute extraction_plan.



7
8
9
# File 'lib/json_data_extractor/schema_analyzer.rb', line 7

def extraction_plan
  @extraction_plan
end

#result_templateObject (readonly)

Returns the value of attribute result_template.



7
8
9
# File 'lib/json_data_extractor/schema_analyzer.rb', line 7

def result_template
  @result_template
end