Class: ArcFurnace::ArraySource
- Inherits:
-
EnumeratorSource
- Object
- Node
- Source
- EnumeratorSource
- ArcFurnace::ArraySource
- Defined in:
- lib/arc-furnace/array_source.rb
Instance Attribute Summary collapse
-
#array ⇒ Object
readonly
Returns the value of attribute array.
Attributes inherited from EnumeratorSource
Attributes inherited from Node
#error_handler, #node_id, #params
Instance Method Summary collapse
- #build_enumerator ⇒ Object
-
#initialize(array:) ⇒ ArraySource
constructor
expects an array of array.
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
#array ⇒ Object (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_enumerator ⇒ Object
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 |