Sha256: 5ce2c2fcac75c7cd8fabdb3e42284d0730d204087501e5551f6d94f62dac803f

Contents?: true

Size: 381 Bytes

Versions: 20

Compression:

Stored size: 381 Bytes

Contents

require 'arc-furnace/enumerator_source'

module ArcFurnace
  class HashSource < ArcFurnace::EnumeratorSource

    attr_reader :hashes

    # expects an array of hashes
    def initialize(hashes:)
      @hashes = hashes
      super()
    end

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

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
arc-furnace-0.1.42 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.41 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.40 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.39 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.38 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.37 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.36 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.35 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.34 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.33 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.32 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.31 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.30 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.29 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.28 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.27 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.26 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.25 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.24 lib/arc-furnace/hash_source.rb
arc-furnace-0.1.23 lib/arc-furnace/hash_source.rb