From a704ace65369c4c9ca6fc71c0f5106203012bf16 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Tue, 6 Sep 2011 11:05:30 +0100 Subject: Fixed up suppression some more, so it works. --- lib/mauve/configuration_builders/person.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/mauve/configuration_builders') 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 -- cgit v1.2.1