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