Class: StreamBatch

Inherits:
Object
  • Object
show all
Defined in:
lib/csv_patch/stream_batch.rb

Instance Method Summary collapse

Constructor Details

#initialize(stream, batch_size) ⇒ StreamBatch

Returns a new instance of StreamBatch.



5
6
7
8
# File 'lib/csv_patch/stream_batch.rb', line 5

def initialize stream, batch_size
  @stream     = stream
  @batch_size = batch_size
end

Instance Method Details

#eachObject



10
11
12
# File 'lib/csv_patch/stream_batch.rb', line 10

def each
  yield next_batch until stream_end?
end