Class: Semaph::Model::PromotionCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/semaph/model/promotion_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pipeline) ⇒ PromotionCollection

Returns a new instance of PromotionCollection.



8
9
10
# File 'lib/semaph/model/promotion_collection.rb', line 8

def initialize(pipeline)
  @pipeline = pipeline
end

Instance Attribute Details

#allObject (readonly)

Returns the value of attribute all.



6
7
8
# File 'lib/semaph/model/promotion_collection.rb', line 6

def all
  @all
end

#pipelineObject (readonly)

Returns the value of attribute pipeline.



6
7
8
# File 'lib/semaph/model/promotion_collection.rb', line 6

def pipeline
  @pipeline
end

Instance Method Details

#reloadObject



12
13
14
15
16
17
18
# File 'lib/semaph/model/promotion_collection.rb', line 12

def reload
  workflow = @pipeline.workflow
  project = workflow.project
  @all = project.client.promotions(@pipeline.id).map do |promotion_response|
    Promotion.new(@pipeline, promotion_response)
  end
end