Class: Bitbar::Concourse::AggregatePresenter
- Inherits:
-
Object
- Object
- Bitbar::Concourse::AggregatePresenter
- Defined in:
- lib/bitbar/concourse/aggregate_presenter.rb
Instance Method Summary collapse
-
#initialize(builds, target_name = nil) ⇒ AggregatePresenter
constructor
A new instance of AggregatePresenter.
- #success? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(builds, target_name = nil) ⇒ AggregatePresenter
Returns a new instance of AggregatePresenter.
6 7 8 9 |
# File 'lib/bitbar/concourse/aggregate_presenter.rb', line 6 def initialize(builds, target_name = nil) @builds = Array(builds.dup) @target_name = target_name end |
Instance Method Details
#success? ⇒ Boolean
19 20 21 |
# File 'lib/bitbar/concourse/aggregate_presenter.rb', line 19 def success? @builds.delete_if(&:success?).empty? end |
#to_s ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/bitbar/concourse/aggregate_presenter.rb', line 11 def to_s if success? "✅ #{@target_name} | color=green" else "❌ #{@target_name} | color=red" end end |