Recurring job, cron style.
Attributes
| block | [R] | The block to call when triggering |
| cron_line | [R] | The CronLine instance, it holds all the info about the cron schedule |
| params | [R] | The job parameters (passed via the schedule method) |
Public class methods
new
(scheduler, cron_string, params, &block)
Creates a new CronJob instance.
[show source]
# File lib/rufus/sc/jobs.rb, line 312 312: def initialize (scheduler, cron_string, params, &block) 313: 314: super 315: 316: @cron_line = case @t 317: 318: when String then CronLine.new(@t) 319: when CronLine then @t 320: 321: else raise "cannot initialize a CronJob out of #{@t.inspect}" 322: end 323: end
Public instance methods
trigger_if_matches
(time)
[show source]
# File lib/rufus/sc/jobs.rb, line 325 325: def trigger_if_matches (time) 326: 327: trigger(time) if @cron_line.matches?(time) 328: end
Protected instance methods
determine_at
()
[show source]
# File lib/rufus/sc/jobs.rb, line 332 332: def determine_at 333: # empty 334: end