Module: Sidetiq::Schedulable::ClassMethods

Includes:
Sidetiq::SubclassTracking
Defined in:
lib/sidetiq/schedulable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Sidetiq::SubclassTracking

#inherited, #subclasses

Instance Attribute Details

#scheduleObject

Public: Returns the Sidetiq::Schedule for this worker.



27
28
29
# File 'lib/sidetiq/schedulable.rb', line 27

def schedule
  @schedule ||= Sidetiq::Schedule.new
end

Instance Method Details

#last_scheduled_occurrenceObject

Public: Returns a Float timestamp of the last scheduled run.



22
23
24
# File 'lib/sidetiq/schedulable.rb', line 22

def last_scheduled_occurrence
  get_timestamp "last"
end

#next_scheduled_occurrenceObject

Public: Returns a Float timestamp of the next scheduled run.



32
33
34
# File 'lib/sidetiq/schedulable.rb', line 32

def next_scheduled_occurrence
  get_timestamp "next"
end

#recurrence(options = {}, &block) ⇒ Object

:nodoc:



36
37
38
39
# File 'lib/sidetiq/schedulable.rb', line 36

def recurrence(options = {}, &block) # :nodoc:
  schedule.instance_eval(&block)
  schedule.set_options(options)
end