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, #running, #scheduler, #t

Instance Method Summary collapse

Methods inherited from SimpleJob

#next_time

Methods inherited from Job

#schedule_info, #tags, #tags=, #trigger_block, #unschedule

Constructor Details

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

Returns a new instance of EveryJob.



257
258
259
260
261
# File 'lib/rufus/sc/jobs.rb', line 257

def initialize (scheduler, t, params, &block)
  super
  determine_frequency
  determine_at
end

Instance Attribute Details

#frequencyObject (readonly)

The frequency, in seconds, of this EveryJob



255
256
257
# File 'lib/rufus/sc/jobs.rb', line 255

def frequency
  @frequency
end

Instance Method Details

#triggerObject

Triggers the job (and reschedules it).



265
266
267
268
269
270
# File 'lib/rufus/sc/jobs.rb', line 265

def trigger

  schedule_next

  super
end