Class: Rufus::Scheduler::SimpleJob
Overview
The base class of at/in/every jobs.
Instance Attribute Summary collapse
-
#at ⇒ Object
readonly
When the job is supposed to trigger.
-
#last ⇒ Object
readonly
Last time it triggered.
Attributes inherited from Job
#block, #job_id, #last_job_thread, #params, #scheduler, #t
Instance Method Summary collapse
- #determine_at ⇒ Object
-
#next_time ⇒ Object
Returns the next time (or the unique time) this job is meant to trigger.
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
#at ⇒ Object (readonly)
When the job is supposed to trigger
282 283 284 |
# File 'lib/rufus/sc/jobs.rb', line 282 def at @at end |
#last ⇒ Object (readonly)
Last time it triggered
286 287 288 |
# File 'lib/rufus/sc/jobs.rb', line 286 def last @last end |
Instance Method Details
#determine_at ⇒ Object
288 289 290 291 |
# File 'lib/rufus/sc/jobs.rb', line 288 def determine_at @at = Rufus.at_to_f(@t) end |
#next_time ⇒ Object
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 |