Class: Rufus::Scheduler::SimpleJob

Inherits:
Job
  • Object
show all
Defined in:
lib/rufus/sc/jobs.rb

Overview

The base class of at/in/every jobs.

Direct Known Subclasses

AtJob, EveryJob, InJob

Instance Attribute Summary collapse

Attributes inherited from Job

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

Instance Method Summary collapse

Methods inherited from Job

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

Constructor Details

This class inherits a constructor from Rufus::Scheduler::Job

Instance Attribute Details

#atObject (readonly)

When the job is supposed to trigger



282
283
284
# File 'lib/rufus/sc/jobs.rb', line 282

def at
  @at
end

#lastObject (readonly)

Last time it triggered



286
287
288
# File 'lib/rufus/sc/jobs.rb', line 286

def last
  @last
end

Instance Method Details

#determine_atObject



288
289
290
291
# File 'lib/rufus/sc/jobs.rb', line 288

def determine_at

  @at = Rufus.at_to_f(@t)
end

#next_timeObject

Returns the next time (or the unique time) this job is meant to trigger



295
296
297
298
# File 'lib/rufus/sc/jobs.rb', line 295

def next_time

  Time.at(@at)
end