2014-01-30 00:21:38 -05:00
|
|
|
module Scheduler::Schedule
|
|
|
|
def every(duration=nil)
|
2014-02-05 18:14:41 -05:00
|
|
|
if duration
|
|
|
|
@every = duration
|
|
|
|
if manager = Scheduler::Manager.current
|
|
|
|
manager.ensure_schedule!(self)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@every
|
|
|
|
end
|
|
|
|
|
|
|
|
def schedule_info
|
|
|
|
manager = Scheduler::Manager.without_runner
|
|
|
|
manager.schedule_info self
|
|
|
|
end
|
|
|
|
|
|
|
|
def scheduled?
|
|
|
|
!!@every
|
2014-01-30 00:21:38 -05:00
|
|
|
end
|
|
|
|
end
|