Class: SidekiqUniqueJobs::OnConflict::Strategy Abstract
- Inherits:
-
Object
- Object
- SidekiqUniqueJobs::OnConflict::Strategy
- Includes:
- Logging
- Defined in:
- lib/sidekiq_unique_jobs/on_conflict/strategy.rb
Overview
This class is abstract.
Abstract conflict strategy class
Direct Known Subclasses
Instance Attribute Summary collapse
-
#item ⇒ Hash
readonly
The sidekiq job hash.
Instance Method Summary collapse
-
#call ⇒ Object
Use strategy on conflict.
-
#initialize(item) ⇒ Strategy
constructor
A new instance of Strategy.
- #replace? ⇒ Boolean
Methods included from Logging
#log_debug, #log_error, #log_fatal, #log_info, #log_warn, #logger, #logging_context
Constructor Details
#initialize(item) ⇒ Strategy
Returns a new instance of Strategy.
17 18 19 |
# File 'lib/sidekiq_unique_jobs/on_conflict/strategy.rb', line 17 def initialize(item) @item = item end |
Instance Attribute Details
#item ⇒ Hash (readonly)
The sidekiq job hash
14 15 16 |
# File 'lib/sidekiq_unique_jobs/on_conflict/strategy.rb', line 14 def item @item end |
Instance Method Details
#call ⇒ Object
Use strategy on conflict
23 24 25 |
# File 'lib/sidekiq_unique_jobs/on_conflict/strategy.rb', line 23 def call raise NotImplementedError, "needs to be implemented in child class" end |
#replace? ⇒ Boolean
27 28 29 |
# File 'lib/sidekiq_unique_jobs/on_conflict/strategy.rb', line 27 def replace? is_a?(Replace) end |