Class: BucketCake::Decoder

Inherits:
Object
  • Object
show all
Defined in:
lib/bucket_cake/decoder.rb

Instance Method Summary collapse

Constructor Details

#initialize(files, klass) ⇒ Decoder

Returns a new instance of Decoder.



5
6
7
8
# File 'lib/bucket_cake/decoder.rb', line 5

def initialize(files, klass)
  @files = files
  @klass = klass
end

Instance Method Details

#itemsObject



10
11
12
13
14
15
16
17
18
# File 'lib/bucket_cake/decoder.rb', line 10

def items
  Enumerator.new do |y|
    files.each do |gzdata|
      unpack(gzdata) do |element|
        y << klass.decode(element)
      end
    end
  end
end