1
0
Fork 0
mirror of https://github.com/endofunky/sidetiq.git synced 2022-11-09 13:53:30 -05:00
endofunky--sidetiq/lib/sidetiq/schedule.rb

23 lines
459 B
Ruby
Raw Normal View History

2013-01-31 12:42:19 -05:00
module Sidetiq
class Schedule < IceCube::Schedule
def method_missing(meth, *args, &block)
if IceCube::Rule.respond_to?(meth)
rule = IceCube::Rule.send(meth, *args, &block)
add_recurrence_rule(rule)
rule
else
super
end
end
def schedule_next?(time)
if @last_scheduled != (no = next_occurrence(time))
@last_scheduled = no
return true
end
false
end
end
end