Class: Rufus::Scheduler::OneTimeJob
- Defined in:
- lib/rufus/scheduler/jobs_one_time.rb
Constant Summary
Constants inherited from Job
Instance Attribute Summary
Attributes inherited from Job
#callable, #count, #handler, #id, #last_time, #last_work_time, #locals, #mean_work_time, #name, #next_time, #opts, #original, #previous_time, #scheduled_at, #tags, #unscheduled_at
Instance Method Summary collapse
- #occurrences(time0, time1) ⇒ Object
-
#past? ⇒ Boolean
Used when discard_past? is set to true or :fail at scheduler or job level…
Methods inherited from Job
#[], #[]=, #call, #check_frequency, #entries, #has_key?, #initialize, #keys, #kill, #next_times, #resume_discard_past=, #running?, #scheduled?, #source_location, #threads, #trigger, #trigger_off_schedule, #unschedule, #values
Constructor Details
This class inherits a constructor from Rufus::Scheduler::Job
Instance Method Details
#occurrences(time0, time1) ⇒ Object
6 7 8 9 |
# File 'lib/rufus/scheduler/jobs_one_time.rb', line 6 def occurrences(time0, time1) (time >= time0 && time <= time1) ? [ time ] : [] end |
#past? ⇒ Boolean
Used when discard_past? is set to true or :fail at scheduler or job level…
13 14 15 16 17 |
# File 'lib/rufus/scheduler/jobs_one_time.rb', line 13 def past? @next_time && @next_time < Time.now - @scheduler.frequency end |