Class: CruiseFace::Model::Pipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/cruise_face/pipeline.rb

Defined Under Namespace

Classes: History

Constant Summary collapse

PASSED_STATUS =
'Passed'
FAILED_STATUS =
'Failed'
CANCELED_STATUS =
'Cancelled'
COMPLETED_STATUS =
[PASSED_STATUS, FAILED_STATUS, CANCELED_STATUS]
BUILDING_STATUS =
'Building'
UNKNOWN_STATUS =
'Unknown'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ Pipeline

Returns a new instance of Pipeline.



149
150
151
152
153
# File 'lib/cruise_face/pipeline.rb', line 149

def initialize(resource)
  @resource = resource
  @name = resource.pipelineName
  @pipeline = resource.groups.first
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



148
149
150
# File 'lib/cruise_face/pipeline.rb', line 148

def name
  @name
end

#resourceObject (readonly)

Returns the value of attribute resource.



148
149
150
# File 'lib/cruise_face/pipeline.rb', line 148

def resource
  @resource
end

Instance Method Details

#historyObject



161
162
163
# File 'lib/cruise_face/pipeline.rb', line 161

def history
  History.new(@pipeline.history.collect { | pipeline | History::Pipeline.new(self.name, pipeline) })
end

#stagesObject



155
156
157
158
159
# File 'lib/cruise_face/pipeline.rb', line 155

def stages
  @pipeline.config.stages.collect do |stage|
    Stage.new(stage, history)
  end
end