aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/configuration_builders/person.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-09-06 11:05:30 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-09-06 11:05:30 +0100
commita704ace65369c4c9ca6fc71c0f5106203012bf16 (patch)
tree79e290515be17a1a38d5b6d7a7b6e0715597cb37 /lib/mauve/configuration_builders/person.rb
parent47e71be469815a725d7e643dfcc95eb1a3012c89 (diff)
Fixed up suppression some more, so it works.
Diffstat (limited to 'lib/mauve/configuration_builders/person.rb')
-rw-r--r--lib/mauve/configuration_builders/person.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/mauve/configuration_builders/person.rb b/lib/mauve/configuration_builders/person.rb
index 014987f..1c012f2 100644
--- a/lib/mauve/configuration_builders/person.rb
+++ b/lib/mauve/configuration_builders/person.rb
@@ -39,10 +39,13 @@ module Mauve
end
def suppress_notifications_after(h)
- raise ArgumentError.new("notification_threshold must be specified as e.g. (10 => 1.minute)") unless
- h.kind_of?(Hash) && h.keys[0].kind_of?(Integer) && h.values[0].kind_of?(Integer)
+ raise ArgumentError.new("notification_threshold must be specified as e.g. (10 => 1.minute)") unless h.kind_of?(Hash)
- @result.notification_thresholds[h.values[0]] = Array.new(h.keys[0])
+ h.each do |k,v|
+ raise ArgumentError.new("notification_threshold must be specified as e.g. (10 => 1.minute)") unless k.is_a?(Integer) and v.is_a?(Integer)
+
+ @result.notification_thresholds[v] = Array.new(k)
+ end
end
end
end