2021-04-13 09:11:10 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module BulkImports
|
|
|
|
class Stage
|
2021-10-13 12:12:20 +00:00
|
|
|
def initialize(bulk_import)
|
|
|
|
raise(ArgumentError, 'Expected an argument of type ::BulkImport') unless bulk_import.is_a?(::BulkImport)
|
|
|
|
|
|
|
|
@bulk_import = bulk_import
|
2021-04-13 09:11:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def pipelines
|
|
|
|
@pipelines ||= config
|
|
|
|
.values
|
|
|
|
.sort_by { |entry| entry[:stage] }
|
|
|
|
.map do |entry|
|
|
|
|
[entry[:stage], entry[:pipeline]]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def config
|
2021-09-13 09:11:26 +00:00
|
|
|
# To be implemented in a sub-class
|
|
|
|
NotImplementedError
|
2021-04-13 09:11:10 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|