Class: BulkImports::Stage

Inherits:
Object
  • Object
show all
Defined in:
lib/bulk_imports/stage.rb

Direct Known Subclasses

Groups::Stage, Projects::Stage

Instance Method Summary collapse

Constructor Details

#initialize(bulk_import_entity) ⇒ Stage

Returns a new instance of Stage.


5
6
7
8
9
10
11
12
# File 'lib/bulk_imports/stage.rb', line 5

def initialize(bulk_import_entity)
  unless bulk_import_entity.is_a?(::BulkImports::Entity)
    raise(ArgumentError, 'Expected an argument of type ::BulkImports::Entity')
  end

  @bulk_import_entity = bulk_import_entity
  @bulk_import = bulk_import_entity.bulk_import
end

Instance Method Details

#pipelinesObject


14
15
16
17
18
19
20
21
# File 'lib/bulk_imports/stage.rb', line 14

def pipelines
  @pipelines ||= config
    .values
    .sort_by { |entry| entry[:stage] }
    .map do |entry|
      [entry[:stage], entry[:pipeline]]
    end
end