Recurring job, cron style.
The block to call when triggering
The CronLine instance, it holds all the info about the cron schedule
The job parameters (passed via the schedule method)
Creates a new CronJob instance.
# File lib/rufus/sc/jobs.rb, line 323 def initialize (scheduler, cron_string, params, &block) super @cron_line = case @t when String then CronLine.new(@t) when CronLine then @t else raise "cannot initialize a CronJob out of #{@t.inspect}" end end
Returns the next time this job is meant to trigger
# File lib/rufus/sc/jobs.rb, line 343 def next_time (from=Time.now) @cron_line.next_time(from) end
# File lib/rufus/sc/jobs.rb, line 336 def trigger_if_matches (time) trigger(time) if @cron_line.matches?(time) end
# File lib/rufus/sc/jobs.rb, line 350 def determine_at # empty end