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

Instance Method Summary collapse

Methods inherited from Job

#initialize, #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



199
200
201
# File 'lib/rufus/sc/jobs.rb', line 199

def at
  @at
end

#lastObject (readonly)

Returns the value of attribute last.



201
202
203
# File 'lib/rufus/sc/jobs.rb', line 201

def last
  @last
end

Instance Method Details

#determine_atObject



203
204
205
206
# File 'lib/rufus/sc/jobs.rb', line 203

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



210
211
212
213
# File 'lib/rufus/sc/jobs.rb', line 210

def next_time

  Time.at(@at)
end