Class: DelayedCron::CronJob
- Inherits:
-
Object
- Object
- DelayedCron::CronJob
- Defined in:
- lib/delayed_cron/cron_job.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#method_name ⇒ Object
Returns the value of attribute method_name.
Instance Method Summary collapse
- #enqueue(processor) ⇒ Object
-
#initialize(options) ⇒ CronJob
constructor
A new instance of CronJob.
Constructor Details
#initialize(options) ⇒ CronJob
Returns a new instance of CronJob.
6 7 8 9 10 11 |
# File 'lib/delayed_cron/cron_job.rb', line 6 def initialize() self.klass = .delete(:klass) self.method_name = .delete(:method_name) self. = end |
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
4 5 6 |
# File 'lib/delayed_cron/cron_job.rb', line 4 def klass @klass end |
#method_name ⇒ Object
Returns the value of attribute method_name.
4 5 6 |
# File 'lib/delayed_cron/cron_job.rb', line 4 def method_name @method_name end |
Instance Method Details
#enqueue(processor) ⇒ Object
13 14 15 16 17 |
# File 'lib/delayed_cron/cron_job.rb', line 13 def enqueue(processor) schedule.each do |opts| processor.enqueue_delayed_cron(klass, method_name, opts) end end |