lib/flapjack/notifier_engine.rb in flapjack-0.5.5 vs lib/flapjack/notifier_engine.rb in flapjack-0.6.23
- old
+ new
@@ -2,27 +2,27 @@
require 'ostruct'
module Flapjack
class NotifierEngine
-
+
attr_reader :log, :notifiers
-
+
def initialize(opts={})
@log = opts[:log]
raise "you have to specify a logger" unless @log
-
+
@notifiers = []
if opts[:notifiers]
opts[:notifiers].each do |n|
@notifiers << n
@log.info("using the #{n.class.to_s.split("::").last} notifier")
end
else
@log.warning("There are no notifiers! flapjack-notifier won't be useful.")
end
end
-
+
def notify!(options={})
result = options[:result]
event = options[:event]
recipients = options[:recipients]