Class: StreamBatch
- Inherits:
-
Object
- Object
- StreamBatch
- Defined in:
- lib/csv_patch/stream_batch.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(stream, batch_size) ⇒ StreamBatch
constructor
A new instance of StreamBatch.
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
#each ⇒ Object
10 11 12 |
# File 'lib/csv_patch/stream_batch.rb', line 10 def each yield next_batch until stream_end? end |