Class: GOCD::Pipeline
- Inherits:
-
Object
- Object
- GOCD::Pipeline
- Defined in:
- lib/gocd/pipeline_status/pipeline.rb
Instance Method Summary collapse
- #green? ⇒ Boolean
-
#initialize(pipeline) ⇒ Pipeline
constructor
A new instance of Pipeline.
- #last_build_label ⇒ Object
- #last_build_status ⇒ Object
- #last_build_time ⇒ Object
- #name ⇒ Object
- #red? ⇒ Boolean
- #status ⇒ Object
- #to_hash ⇒ Object
- #web_url ⇒ Object
Constructor Details
#initialize(pipeline) ⇒ Pipeline
Returns a new instance of Pipeline.
3 4 5 |
# File 'lib/gocd/pipeline_status/pipeline.rb', line 3 def initialize(pipeline) @pipeline = pipeline end |
Instance Method Details
#green? ⇒ Boolean
23 24 25 |
# File 'lib/gocd/pipeline_status/pipeline.rb', line 23 def green? @pipeline['lastBuildStatus'] == 'Success' end |
#last_build_label ⇒ Object
35 36 37 |
# File 'lib/gocd/pipeline_status/pipeline.rb', line 35 def last_build_label @pipeline['lastBuildLabel'] end |
#last_build_status ⇒ Object
11 12 13 |
# File 'lib/gocd/pipeline_status/pipeline.rb', line 11 def last_build_status @pipeline['lastBuildStatus'] end |
#last_build_time ⇒ Object
31 32 33 |
# File 'lib/gocd/pipeline_status/pipeline.rb', line 31 def last_build_time @pipeline['lastBuildTime'] end |
#name ⇒ Object
7 8 9 |
# File 'lib/gocd/pipeline_status/pipeline.rb', line 7 def name @pipeline['name'] end |
#red? ⇒ Boolean
19 20 21 |
# File 'lib/gocd/pipeline_status/pipeline.rb', line 19 def red? @pipeline['lastBuildStatus'] == 'Failure' end |
#status ⇒ Object
15 16 17 |
# File 'lib/gocd/pipeline_status/pipeline.rb', line 15 def status {pipeline: name, status: last_build_status} end |
#to_hash ⇒ Object
39 40 41 |
# File 'lib/gocd/pipeline_status/pipeline.rb', line 39 def to_hash @pipeline end |
#web_url ⇒ Object
27 28 29 |
# File 'lib/gocd/pipeline_status/pipeline.rb', line 27 def web_url @pipeline['webUrl'] end |