Class: Rearview::Alerts::CampfireAlert

Inherits:
Base
  • Object
show all
Defined in:
lib/rearview/alerts/campfire_alert.rb

Instance Method Summary collapse

Methods inherited from Base

key_to_params, valid_scheme?

Methods included from Logger

#logger

Instance Method Details

#alert(job, result) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/rearview/alerts/campfire_alert.rb', line 7

def alert(job, result)
  job.alert_keys.each do |key|
    params = CampfireAlert.params(key)
    if CampfireAlert.key?(params)
      logger.info "#{self} send alert for #{job.inspect} and key #{key} with params #{params}"
      Broach.settings = params
      Broach.speak(params["room"], alert_msg(job, result))
    end
  end
end