a little refactoring

This commit is contained in:
John Bintz 2010-01-04 22:00:34 -05:00
parent 46856b7b05
commit 2758239c1a

View File

@ -50,27 +50,26 @@ class Scheduler
while dates.length < to_produce while dates.length < to_produce
interval = parameters['interval'].shift interval = parameters['interval'].shift
case interval.class.to_s what_to_add = nil
when 'String'
current = skip_to_dow(current, interval)
if ok_to_add(current, index, prior, breaks) if interval.is_a? String
dates << current current = skip_to_dow(current, interval)
prior = current
index += 1
end
current += 1 what_to_add = 1
when 'Fixnum'
if ok_to_add(current, index, prior, breaks)
dates << current
prior = current
index += 1
end
current += interval
end end
if ok_to_add(current, index, prior, breaks)
dates << current
prior = current
index += 1
end
if interval.is_a? Fixnum
what_to_add = interval
end
current += what_to_add
parameters['interval'] << interval parameters['interval'] << interval
end end
end end