diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-04-23 16:01:44 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-04-23 16:01:44 +0100 |
commit | 6561f886ed03a79ca035a1733816ab97380576d2 (patch) | |
tree | 24282c1a9f85a6a1f1eb010df7c421f3c08315bb /lib/mauve/configuration_builders/person.rb | |
parent | ca99b0dff974d2fc841d7132d03b3ad1d1bf9b1e (diff) |
Persons/PeopleLists can now specify multiple notification preferences.
Diffstat (limited to 'lib/mauve/configuration_builders/person.rb')
-rw-r--r-- | lib/mauve/configuration_builders/person.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/mauve/configuration_builders/person.rb b/lib/mauve/configuration_builders/person.rb index 7881d01..dff6f85 100644 --- a/lib/mauve/configuration_builders/person.rb +++ b/lib/mauve/configuration_builders/person.rb @@ -2,6 +2,7 @@ require 'object_builder' require 'mauve/person' require 'mauve/configuration_builder' +require 'mauve/configuration_builders/alert_group' module Mauve module ConfigurationBuilders @@ -12,11 +13,11 @@ module Mauve @result = Mauve::Person.new(username) end + is_builder "notification", Notification + is_block_attribute "urgent" is_block_attribute "normal" is_block_attribute "low" - is_block_attribute "during" - is_attribute "every" is_attribute "password" is_attribute "sms" is_attribute "holiday_url" @@ -29,6 +30,18 @@ module Mauve # @param [Block] block def all(&block); urgent(&block); normal(&block); low(&block); end + # + # Notify is a shortcut for "notification" + # + def notify(&block) + notification(@result, &block) + end + + def created_notification(notification) + @result.notifications ||= [] + @result.notifications << notification + end + # Notification suppression hash # # @param [Hash] h @@ -41,6 +54,7 @@ module Mauve @result.notification_thresholds[v] = Array.new(k) end end + end end |