Class: ArcFurnace::ArraySource

Inherits:
EnumeratorSource show all
Defined in:
lib/arc-furnace/array_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(array:) ⇒ ArraySource

expects an array of array



9
10
11
12
# File 'lib/arc-furnace/array_source.rb', line 9

def initialize(array:)
  @array = array
  super()
end

Instance Attribute Details

#arrayObject (readonly)

Returns the value of attribute array.



6
7
8
# File 'lib/arc-furnace/array_source.rb', line 6

def array
  @array
end

Instance Method Details

#build_enumeratorObject



14
15
16
17
18
# File 'lib/arc-furnace/array_source.rb', line 14

def build_enumerator
  Enumerator.new do |yielder|
    array.each { |hash| yielder.yield(hash) }
  end
end