Class: CsvPatch::Batches
- Inherits:
-
Object
- Object
- CsvPatch::Batches
- Defined in:
- lib/csv_patch/batches.rb
Constant Summary collapse
- DEFAULT_BATCH_SIZE =
500
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options) ⇒ Batches
constructor
A new instance of Batches.
Constructor Details
#initialize(options) ⇒ Batches
Returns a new instance of Batches.
10 11 12 13 14 15 |
# File 'lib/csv_patch/batches.rb', line 10 def initialize @intermediate_files = [] @input, @output = [:input], [:output] @batches = StreamBatch.new([:changes], [:batch_size] || DEFAULT_BATCH_SIZE) @id_column = [:id_column] end |
Instance Method Details
#execute ⇒ Object
17 18 19 20 |
# File 'lib/csv_patch/batches.rb', line 17 def execute apply_changes_in_batches close_intermediate_files end |