diff options
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 |