Class: ArcFurnace::SalsifyJSONSource
- Inherits:
-
EnumeratorSource
- Object
- Node
- Source
- EnumeratorSource
- ArcFurnace::SalsifyJSONSource
- Defined in:
- lib/arc-furnace/salsify_json_source.rb
Instance Attribute Summary collapse
-
#salsify_json ⇒ Object
readonly
Returns the value of attribute salsify_json.
Attributes inherited from EnumeratorSource
Attributes inherited from Node
#error_handler, #node_id, #params
Instance Method Summary collapse
- #build_enumerator ⇒ Object
-
#initialize(salsify_json:) ⇒ SalsifyJSONSource
constructor
A new instance of SalsifyJSONSource.
Methods inherited from EnumeratorSource
#advance, #empty?, #preprocess
Methods inherited from Source
#advance, #close, #empty?, #finalize, #prepare, #row, #value
Constructor Details
#initialize(salsify_json:) ⇒ SalsifyJSONSource
Returns a new instance of SalsifyJSONSource.
8 9 10 11 |
# File 'lib/arc-furnace/salsify_json_source.rb', line 8 def initialize(salsify_json:) @salsify_json = salsify_json super() end |
Instance Attribute Details
#salsify_json ⇒ Object (readonly)
Returns the value of attribute salsify_json.
6 7 8 |
# File 'lib/arc-furnace/salsify_json_source.rb', line 6 def salsify_json @salsify_json end |
Instance Method Details
#build_enumerator ⇒ Object
13 14 15 16 17 |
# File 'lib/arc-furnace/salsify_json_source.rb', line 13 def build_enumerator Enumerator.new do |yielder| salsify_json.products.each { |product| yielder.yield(product) } end end |