# File lib/seed_dump/dump_methods/enumeration.rb, line 35 def enumerable_enumeration(records, io, options) num_of_batches, batch_size = batch_params_from(records, options) record_strings = [] batch_number = 1 records.each_with_index do |record, i| record_strings << dump_record(record, options) last_batch = (i == records.length - 1) if (record_strings.length == batch_size) || last_batch yield record_strings, last_batch record_strings = [] batch_number += 1 end end end