Class: BucketCake::Decoder
- Inherits:
-
Object
- Object
- BucketCake::Decoder
- Defined in:
- lib/bucket_cake/decoder.rb
Instance Method Summary collapse
-
#initialize(files, klass) ⇒ Decoder
constructor
A new instance of Decoder.
- #items ⇒ Object
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
#items ⇒ Object
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 |