Class: CachedCounter::RetriedJob
- Inherits:
-
Object
- Object
- CachedCounter::RetriedJob
- Defined in:
- lib/cached_counter.rb
Instance Method Summary collapse
- #enqueue! ⇒ Object
-
#initialize(model_class:, id:, attribute:, method:) ⇒ RetriedJob
constructor
A new instance of RetriedJob.
- #max_attempts ⇒ Object
- #perform ⇒ Object
Constructor Details
#initialize(model_class:, id:, attribute:, method:) ⇒ RetriedJob
Returns a new instance of RetriedJob.
210 211 212 213 214 215 |
# File 'lib/cached_counter.rb', line 210 def initialize(model_class:, id:, attribute:, method:) @model_class = model_class @id = id @attribute = attribute @method = method end |
Instance Method Details
#enqueue! ⇒ Object
225 226 227 |
# File 'lib/cached_counter.rb', line 225 def enqueue! Delayed::Job.enqueue self end |
#max_attempts ⇒ Object
221 222 223 |
# File 'lib/cached_counter.rb', line 221 def max_attempts 10 end |
#perform ⇒ Object
217 218 219 |
# File 'lib/cached_counter.rb', line 217 def perform CachedCounter.new(model_class: @model_class, id: @id, attribute: @attribute).send(@method) end |