Class: Rufus::Scheduler::EveryJob

Inherits:
SimpleJob show all
Defined in:
lib/rufus/sc/jobs.rb

Overview

Recurring job with a certain frequency.

Instance Attribute Summary collapse

Attributes inherited from SimpleJob

#at, #last

Attributes inherited from Job

#block, #job_id, #last, #last_job_thread, #params, #scheduler, #t

Instance Method Summary collapse

Methods inherited from SimpleJob

#next_time

Methods inherited from Job

#pause, #paused?, #resume, #running, #schedule_info, #tags, #tags=, #trigger_block, #unschedule

Constructor Details

#initialize(scheduler, t, params, &block) ⇒ EveryJob

Returns a new instance of EveryJob.



347
348
349
350
351
352
353
# File 'lib/rufus/sc/jobs.rb', line 347

def initialize(scheduler, t, params, &block)

  super

  determine_frequency
  determine_at
end

Instance Attribute Details

#frequencyObject (readonly)

The frequency, in seconds, of this EveryJob



345
346
347
# File 'lib/rufus/sc/jobs.rb', line 345

def frequency
  @frequency
end

Instance Method Details

#triggerObject

Triggers the job (and reschedules it).



357
358
359
360
361
362
# File 'lib/rufus/sc/jobs.rb', line 357

def trigger

  schedule_next

  super
end