minicomic-backend/classes/Scheduler.rb

33 lines
503 B
Ruby
Raw Normal View History

2010-01-04 04:43:58 +00:00
require 'singleton'
class Scheduler
include Singleton
WEEKLY = [ 7 ]
def schedule(parameters, to_produce)
dates = []
if parameters[:start]
current = parameters[:start]
1.upto(to_produce) do |i|
interval = parameters[:interval].shift
case interval.class.to_s
when 'Symbol'
when 'Fixnum'
end
dates << current
current += interval
parameters[:interval] << interval
end
end
dates
end
end