lib/job-iteration/enumerator_builder.rb in job-iteration-1.3.4 vs lib/job-iteration/enumerator_builder.rb in job-iteration-1.3.5
- old
+ new
@@ -136,16 +136,21 @@
throttle_on: throttle_on,
backoff: backoff
).to_enum
end
+ def build_csv_enumerator(enumerable, cursor:)
+ CsvEnumerator.new(enumerable).rows(cursor: cursor)
+ end
+
alias_method :once, :build_once_enumerator
alias_method :times, :build_times_enumerator
alias_method :array, :build_array_enumerator
alias_method :active_record_on_records, :build_active_record_enumerator_on_records
alias_method :active_record_on_batches, :build_active_record_enumerator_on_batches
alias_method :active_record_on_batch_relations, :build_active_record_enumerator_on_batch_relations
alias_method :throttle, :build_throttle_enumerator
+ alias_method :csv, :build_csv_enumerator
private
def build_active_record_enumerator(scope, cursor:, **args)
unless scope.is_a?(ActiveRecord::Relation)