Class: CruiseFace::Model::Pipeline::History::Stage
- Inherits:
-
Object
- Object
- CruiseFace::Model::Pipeline::History::Stage
- Defined in:
- lib/cruise_face/pipeline.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#building? ⇒ Boolean
the stageStatus maybe ‘Failed’ when there is one job failed and others are still building.
- #committers ⇒ Object
- #completed? ⇒ Boolean
- #counter ⇒ Object
-
#initialize(pipeline, resource) ⇒ Stage
constructor
A new instance of Stage.
- #jobs ⇒ Object
- #name ⇒ Object
- #to_s ⇒ Object
- #unknown? ⇒ Boolean
Constructor Details
#initialize(pipeline, resource) ⇒ Stage
Returns a new instance of Stage.
55 56 57 58 |
# File 'lib/cruise_face/pipeline.rb', line 55 def initialize(pipeline, resource) @pipeline = pipeline @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
54 55 56 |
# File 'lib/cruise_face/pipeline.rb', line 54 def resource @resource end |
Instance Method Details
#building? ⇒ Boolean
the stageStatus maybe ‘Failed’ when there is one job failed and others are still building
73 74 75 |
# File 'lib/cruise_face/pipeline.rb', line 73 def building? jobs.any? {|job| job.incompleted?} end |
#committers ⇒ Object
60 61 62 |
# File 'lib/cruise_face/pipeline.rb', line 60 def committers @pipeline.committers end |
#completed? ⇒ Boolean
64 65 66 |
# File 'lib/cruise_face/pipeline.rb', line 64 def completed? !building? end |
#counter ⇒ Object
81 82 83 |
# File 'lib/cruise_face/pipeline.rb', line 81 def counter @resource.stageCounter end |
#jobs ⇒ Object
89 90 91 |
# File 'lib/cruise_face/pipeline.rb', line 89 def jobs @jobs ||= @pipeline.find_jobs(self) end |
#name ⇒ Object
77 78 79 |
# File 'lib/cruise_face/pipeline.rb', line 77 def name @resource.stageName end |
#to_s ⇒ Object
85 86 87 |
# File 'lib/cruise_face/pipeline.rb', line 85 def to_s "#{name}<#{counter}>[#{@pipeline}]" end |
#unknown? ⇒ Boolean
68 69 70 |
# File 'lib/cruise_face/pipeline.rb', line 68 def unknown? UNKNOWN_STATUS == @resource.stageStatus end |