Module: Build::States
Instance Method Summary collapse
- #color ⇒ Object
- #failed? ⇒ Boolean
- #finish(data = {}) ⇒ Object
- #passed? ⇒ Boolean
- #pending? ⇒ Boolean
- #start(data = {}) ⇒ Object
Instance Method Details
#color ⇒ Object
39 40 41 |
# File 'lib/travis/model/build/states.rb', line 39 def color pending? ? 'yellow' : passed? ? 'green' : 'red' end |
#failed? ⇒ Boolean
35 36 37 |
# File 'lib/travis/model/build/states.rb', line 35 def failed? !passed? end |
#finish(data = {}) ⇒ Object
22 23 24 25 |
# File 'lib/travis/model/build/states.rb', line 22 def finish(data = {}) self.status = matrix_status self.finished_at = data[:finished_at] end |
#passed? ⇒ Boolean
31 32 33 |
# File 'lib/travis/model/build/states.rb', line 31 def passed? status == 0 end |
#pending? ⇒ Boolean
27 28 29 |
# File 'lib/travis/model/build/states.rb', line 27 def pending? !finished? end |
#start(data = {}) ⇒ Object
18 19 20 |
# File 'lib/travis/model/build/states.rb', line 18 def start(data = {}) self.started_at = data[:started_at] end |