Class: Rufus::Scheduler::EveryJob
- Defined in:
- lib/rufus/scheduler/jobs.rb
Instance Attribute Summary collapse
-
#frequency ⇒ Object
readonly
Returns the value of attribute frequency.
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, duration, opts, block) ⇒ EveryJob
constructor
A new instance of EveryJob.
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, duration, opts, block) ⇒ EveryJob
Returns a new instance of EveryJob.
519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/rufus/scheduler/jobs.rb', line 519 def initialize(scheduler, duration, opts, block) super(scheduler, duration, opts, block) @frequency = Rufus::Scheduler.parse_in(@original) raise ArgumentError.new( "cannot schedule #{self.class} with a frequency " + "of #{@frequency.inspect} (#{@original.inspect})" ) if @frequency <= 0 set_next_time(nil) end |
Instance Attribute Details
#frequency ⇒ Object (readonly)
Returns the value of attribute frequency.
517 518 519 |
# File 'lib/rufus/scheduler/jobs.rb', line 517 def frequency @frequency end |