Class: Terrestrial::GraphLoader
- Inherits:
-
Object
- Object
- Terrestrial::GraphLoader
- Defined in:
- lib/terrestrial/graph_loader.rb
Instance Attribute Summary collapse
-
#datasets ⇒ Object
readonly
Returns the value of attribute datasets.
-
#mappings ⇒ Object
readonly
Returns the value of attribute mappings.
-
#object_load_pipeline ⇒ Object
readonly
Returns the value of attribute object_load_pipeline.
Instance Method Summary collapse
- #call(mapping_name, record, eager_data_graph = {}) ⇒ Object
-
#initialize(datasets:, mappings:, object_load_pipeline:) ⇒ GraphLoader
constructor
A new instance of GraphLoader.
Constructor Details
#initialize(datasets:, mappings:, object_load_pipeline:) ⇒ GraphLoader
Returns a new instance of GraphLoader.
3 4 5 6 7 |
# File 'lib/terrestrial/graph_loader.rb', line 3 def initialize(datasets:, mappings:, object_load_pipeline:) @datasets = datasets @mappings = mappings @object_load_pipeline = object_load_pipeline end |
Instance Attribute Details
#datasets ⇒ Object (readonly)
Returns the value of attribute datasets.
9 10 11 |
# File 'lib/terrestrial/graph_loader.rb', line 9 def datasets @datasets end |
#mappings ⇒ Object (readonly)
Returns the value of attribute mappings.
9 10 11 |
# File 'lib/terrestrial/graph_loader.rb', line 9 def mappings @mappings end |
#object_load_pipeline ⇒ Object (readonly)
Returns the value of attribute object_load_pipeline.
9 10 11 |
# File 'lib/terrestrial/graph_loader.rb', line 9 def object_load_pipeline @object_load_pipeline end |
Instance Method Details
#call(mapping_name, record, eager_data_graph = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/terrestrial/graph_loader.rb', line 11 def call(mapping_name, record, eager_data_graph = {}) mapping = mappings.fetch(mapping_name) load_record(mapping, record, eager_data_graph) end |