Class: Bitbar::Concourse::AggregatePresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/bitbar/concourse/aggregate_presenter.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


19
20
21
# File 'lib/bitbar/concourse/aggregate_presenter.rb', line 19

def success?
  @builds.delete_if(&:success?).empty?
end

#to_sObject



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