aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-06-08 10:31:25 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-06-08 10:31:25 +0100
commit4f6ff88393027210d8710bee1d2b1b329a426922 (patch)
tree85e53e573aea33b55b79fc08aea6dfdbafa4a401 /lib/mauve
parentd67ea28693088e4d7039069b52541777eb7aa989 (diff)
Fixed notify_when_on_holiday/off_sick flags in configuration + added tests.
Diffstat (limited to 'lib/mauve')
-rw-r--r--lib/mauve/configuration_builders/person.rb8
-rw-r--r--lib/mauve/person.rb8
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/mauve/configuration_builders/person.rb b/lib/mauve/configuration_builders/person.rb
index bb4fe8d..f171d10 100644
--- a/lib/mauve/configuration_builders/person.rb
+++ b/lib/mauve/configuration_builders/person.rb
@@ -25,8 +25,8 @@ module Mauve
is_attribute "email"
is_attribute "xmpp"
- is_flag_attribute "notify_when_on_holiday!"
- is_flag_attribute "notify_when_off_sick!"
+ is_flag_attribute "notify_when_on_holiday"
+ is_flag_attribute "notify_when_off_sick"
# Sets the block for all levels of alert
#
@@ -61,11 +61,11 @@ module Mauve
#
#
def notify_when_on_holday!
- result.notify_when_on_holiday!
+ result.notify_when_on_holiday = true
end
def notify_when_off_sick!
- result.notify_when_off_sick!
+ result.notify_when_off_sick = true
end
end
diff --git a/lib/mauve/person.rb b/lib/mauve/person.rb
index 6ad6706..a82c539 100644
--- a/lib/mauve/person.rb
+++ b/lib/mauve/person.rb
@@ -32,16 +32,16 @@ module Mauve
#
# @return [Boolean]
#
- def notify_when_off_sick!
- @notify_when_off_sick = true
+ def notify_when_off_sick=(arg)
+ @notify_when_off_sick = (arg ? true : false)
end
# Determines if a user should be notified if they're on their holdiays.
#
# @return [Boolean]
#
- def notify_when_on_holiday!
- @notify_when_on_holiday = true
+ def notify_when_on_holiday=(arg)
+ @notify_when_on_holiday = (arg ? true : false)
end
# Sets the Proc to call for urgent notifications