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 430 def initialize(scheduler, cron_string, params, &block) super @cron_line = case @t when String then CronLine.new(@t) when CronLine then @t else raise ArgumentError.new( "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 453 def next_time(from=Time.now) @cron_line.next_time(from) end
# File lib/rufus/sc/jobs.rb, line 444 def trigger_if_matches(time) return if @paused trigger(time) if @cron_line.matches?(time) end
# File lib/rufus/sc/jobs.rb, line 460 def determine_at # empty end