Class: CruiseFace::Model::Pipeline::History::Job
- Inherits:
-
Object
- Object
- CruiseFace::Model::Pipeline::History::Job
- Defined in:
- lib/cruise_face/pipeline.rb
Instance Attribute Summary collapse
-
#stage ⇒ Object
readonly
Returns the value of attribute stage.
Instance Method Summary collapse
- #completed? ⇒ Boolean
- #current_build_duration ⇒ Object
- #failed? ⇒ Boolean
- #incompleted? ⇒ Boolean
-
#initialize(stage, resource) ⇒ Job
constructor
A new instance of Job.
- #last_build_duration ⇒ Object
- #name ⇒ Object
- #passed? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(stage, resource) ⇒ Job
Returns a new instance of Job.
97 98 99 100 |
# File 'lib/cruise_face/pipeline.rb', line 97 def initialize(stage, resource) @stage = stage @resource = resource end |
Instance Attribute Details
#stage ⇒ Object (readonly)
Returns the value of attribute stage.
95 96 97 |
# File 'lib/cruise_face/pipeline.rb', line 95 def stage @stage end |
Instance Method Details
#completed? ⇒ Boolean
114 115 116 |
# File 'lib/cruise_face/pipeline.rb', line 114 def completed? @resource.is_completed == 'true' end |
#current_build_duration ⇒ Object
126 127 128 |
# File 'lib/cruise_face/pipeline.rb', line 126 def current_build_duration @resource.current_build_duration end |
#failed? ⇒ Boolean
110 111 112 |
# File 'lib/cruise_face/pipeline.rb', line 110 def failed? [FAILED_STATUS, CANCELED_STATUS].include? @resource.result end |
#incompleted? ⇒ Boolean
118 119 120 |
# File 'lib/cruise_face/pipeline.rb', line 118 def incompleted? !completed? end |
#last_build_duration ⇒ Object
122 123 124 |
# File 'lib/cruise_face/pipeline.rb', line 122 def last_build_duration @resource.last_build_duration end |
#name ⇒ Object
102 103 104 |
# File 'lib/cruise_face/pipeline.rb', line 102 def name @resource.name end |
#passed? ⇒ Boolean
106 107 108 |
# File 'lib/cruise_face/pipeline.rb', line 106 def passed? @resource.result == PASSED_STATUS end |
#to_s ⇒ Object
130 131 132 |
# File 'lib/cruise_face/pipeline.rb', line 130 def to_s "Job #{name}[#{@stage}] #{completed? ? 'completed' : ''} #{failed? ? "failed" : (passed? ? 'passed' : 'unknown')}" end |