aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/notification.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mauve/notification.rb')
-rw-r--r--lib/mauve/notification.rb42
1 files changed, 16 insertions, 26 deletions
diff --git a/lib/mauve/notification.rb b/lib/mauve/notification.rb
index 3c7270e..d06e03a 100644
--- a/lib/mauve/notification.rb
+++ b/lib/mauve/notification.rb
@@ -182,17 +182,19 @@ module Mauve
# at a particular alert level, on a periodic basis, and optionally under
# certain conditions specified by a block of code.
#
- class Notification < Struct.new(:person, :level)
+ class Notification
+
+ attr_reader :during, :every, :level, :person
# Set up a new notification
#
# @param [Array] person List of Mauve::Person to notify
# @param [Symbol] level Level at which to notify
- def initialize(person, level)
- self.level = level
- self.every = nil
- self.during = nil
- self.person = person
+ def initialize(person)
+ @person = person
+ @during = nil
+ @every = nil
+ @level = nil
end
# @return [String]
@@ -203,34 +205,22 @@ module Mauve
# @return Log4r::Logger
def logger ; Log4r::Logger.new self.class.to_s ; end
- #
- #
- #
- def during
- @during ||= person.during
- end
-
- #
- #
- #
def during=(arg)
@during = arg
end
- #
- #
- #
- def every
- @every ||= person.during
- end
-
- #
- #
- #
def every=(arg)
@every = arg
end
+ def level=(arg)
+ @level = arg
+ end
+
+ def person=(arg)
+ @person = arg
+ end
+
# Push a notification on to the queue for this alert. The Mauve::Notifier
# will then pop it off and do the notification in a separate thread.
#