Class: ArcFurnace::SalsifyJSONSource

Inherits:
EnumeratorSource show all
Defined in:
lib/arc-furnace/salsify_json_source.rb

Instance Attribute Summary collapse

Attributes inherited from EnumeratorSource

#value

Attributes inherited from Node

#error_handler, #node_id, #params

Instance Method Summary collapse

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_jsonObject (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_enumeratorObject



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