Class: Rufus::Scheduler::IntervalJob
- Defined in:
- lib/rufus/scheduler/jobs.rb
Instance Attribute Summary collapse
-
#interval ⇒ Object
readonly
Returns the value of attribute interval.
Attributes inherited from RepeatJob
#first_at, #last_at, #paused_at, #times
Attributes inherited from Job
#callable, #count, #handler, #id, #last_time, #last_work_time, #mean_work_time, #next_time, #opts, #original, #scheduled_at, #tags, #unscheduled_at
Instance Method Summary collapse
-
#initialize(scheduler, interval, opts, block) ⇒ IntervalJob
constructor
A new instance of IntervalJob.
Methods inherited from EvInJob
Methods inherited from RepeatJob
#determine_id, #occurrences, #pause, #paused?, #resume, #trigger
Methods inherited from Job
#[], #[]=, #call, #key?, #keys, #kill, #running?, #scheduled?, #threads, #trigger, #unschedule
Constructor Details
#initialize(scheduler, interval, opts, block) ⇒ IntervalJob
Returns a new instance of IntervalJob.
557 558 559 560 561 562 563 564 565 566 567 568 569 |
# File 'lib/rufus/scheduler/jobs.rb', line 557 def initialize(scheduler, interval, opts, block) super(scheduler, interval, opts, block) @interval = Rufus::Scheduler.parse_in(@original) raise ArgumentError.new( "cannot schedule #{self.class} with an interval " + "of #{@interval.inspect} (#{@original.inspect})" ) if @interval <= 0 set_next_time(nil) end |
Instance Attribute Details
#interval ⇒ Object (readonly)
Returns the value of attribute interval.
555 556 557 |
# File 'lib/rufus/scheduler/jobs.rb', line 555 def interval @interval end |