Rufus::Scheduler::CronJob

Recurring job, cron style.

Attributes

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)

block[R]

The block to call when triggering

Public Class Methods

new(scheduler, cron_string, params, &block) click to toggle source

Creates a new CronJob instance.

     # File lib/rufus/sc/jobs.rb, line 329
329:     def initialize(scheduler, cron_string, params, &block)
330: 
331:       super
332: 
333:       @cron_line = case @t
334: 
335:         when String then CronLine.new(@t)
336:         when CronLine then @t
337: 
338:         else raise ArgumentError.new(
339:           "cannot initialize a CronJob out of #{@t.inspect}")
340:       end
341:     end

Public Instance Methods

next_time(from=Time.now) click to toggle source

Returns the next time this job is meant to trigger

     # File lib/rufus/sc/jobs.rb, line 350
350:     def next_time(from=Time.now)
351: 
352:       @cron_line.next_time(from)
353:     end
trigger_if_matches(time) click to toggle source
     # File lib/rufus/sc/jobs.rb, line 343
343:     def trigger_if_matches(time)
344: 
345:       trigger(time) if @cron_line.matches?(time)
346:     end

Protected Instance Methods

determine_at() click to toggle source
     # File lib/rufus/sc/jobs.rb, line 357
357:     def determine_at
358: 
359:       # empty
360:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.