Class: CsvPatch::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.



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

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

Instance Method Details

#eachObject



13
14
15
# File 'lib/csv_patch/stream_batch.rb', line 13

def each
  yield next_batch until stream_end?
end