diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-05-03 19:35:26 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-05-03 19:35:26 +0100 |
commit | dc1bbf37f31b4478aef43051ea6494f23cfe04b0 (patch) | |
tree | 72f023f5dfce7c3e5b1aefb499ccbf3e72ab8175 /lib/mauve/configuration.rb | |
parent | 757853bb96c2f75bcb28f16fcf80601abee48033 (diff) |
Update Time.bank_holiday? etc. to work correctly.
Mauve::Configuration#do_parse_time now a class method, and used elsewhere to
standardise ranges in the configuration file.
Diffstat (limited to 'lib/mauve/configuration.rb')
-rw-r--r-- | lib/mauve/configuration.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/mauve/configuration.rb b/lib/mauve/configuration.rb index 55bdd9f..4ee71dd 100644 --- a/lib/mauve/configuration.rb +++ b/lib/mauve/configuration.rb @@ -32,10 +32,6 @@ module Mauve # @return [Array] attr_reader :alert_groups - # People lists - # @return [Hash] - attr_reader :people_lists - # The source lists # @return [Hash] attr_reader :source_lists @@ -53,7 +49,6 @@ module Mauve @server = nil @notification_methods = {} @people = {} - @people_lists = {} @source_lists = Hash.new{|h,k| h[k] = Mauve::SourceList.new(k)} @alert_groups = [] @@ -177,19 +172,17 @@ module Mauve end def working_hours=(arg) - @working_hours = do_parse_range(arg) + @working_hours = self.class.parse_range(arg) end def daytime_hours=(arg) - @daytime_hours = do_parse_range(arg) + @daytime_hours = self.class.parse_range(arg) end def dead_zone=(arg) - @dead_zone = do_parse_range(arg) + @dead_zone = self.class.parse_range(arg) end - private - # This method takes a range, and wraps it within the specs defined by # allowed_range. # @@ -197,7 +190,7 @@ module Mauve # # @param # - def do_parse_range(arg, allowed_range = (0...24)) + def self.parse_range(arg, allowed_range = (0...24)) args = [arg].flatten # |