Module: Wurk::Job::Options::ClassMethods
- Defined in:
- lib/wurk/job/options.rb
Instance Attribute Summary collapse
-
#sidekiq_retries_exhausted_block ⇒ Object
readonly
Returns the value of attribute sidekiq_retries_exhausted_block.
-
#sidekiq_retry_in_block ⇒ Object
readonly
Returns the value of attribute sidekiq_retry_in_block.
Instance Method Summary collapse
-
#get_sidekiq_options ⇒ Object
Sidekiq’s public API name — must stay ‘get_sidekiq_options`.
- #inherited(subclass) ⇒ Object
- #sidekiq_options(opts = {}) ⇒ Object
- #sidekiq_options_hash ⇒ Object
- #sidekiq_retries_exhausted(&block) ⇒ Object
- #sidekiq_retry_in(&block) ⇒ Object
Instance Attribute Details
#sidekiq_retries_exhausted_block ⇒ Object (readonly)
Returns the value of attribute sidekiq_retries_exhausted_block.
35 36 37 |
# File 'lib/wurk/job/options.rb', line 35 def sidekiq_retries_exhausted_block @sidekiq_retries_exhausted_block end |
#sidekiq_retry_in_block ⇒ Object (readonly)
Returns the value of attribute sidekiq_retry_in_block.
35 36 37 |
# File 'lib/wurk/job/options.rb', line 35 def sidekiq_retry_in_block @sidekiq_retry_in_block end |
Instance Method Details
#get_sidekiq_options ⇒ Object
Sidekiq’s public API name — must stay ‘get_sidekiq_options`.
27 28 29 |
# File 'lib/wurk/job/options.rb', line 27 def # rubocop:disable Naming/AccessorMethodName @sidekiq_options_hash ||= # rubocop:disable Naming/MemoizedInstanceVariableName end |
#inherited(subclass) ⇒ Object
45 46 47 48 49 50 |
# File 'lib/wurk/job/options.rb', line 45 def inherited(subclass) super subclass.instance_variable_set(:@sidekiq_options_hash, .dup) inherit_ivar(subclass, :@sidekiq_retry_in_block) inherit_ivar(subclass, :@sidekiq_retries_exhausted_block) end |
#sidekiq_options(opts = {}) ⇒ Object
21 22 23 24 |
# File 'lib/wurk/job/options.rb', line 21 def (opts = {}) merged = .merge(opts.transform_keys(&:to_s)) @sidekiq_options_hash = merged end |
#sidekiq_options_hash ⇒ Object
31 32 33 |
# File 'lib/wurk/job/options.rb', line 31 def end |
#sidekiq_retries_exhausted(&block) ⇒ Object
41 42 43 |
# File 'lib/wurk/job/options.rb', line 41 def sidekiq_retries_exhausted(&block) @sidekiq_retries_exhausted_block = block end |
#sidekiq_retry_in(&block) ⇒ Object
37 38 39 |
# File 'lib/wurk/job/options.rb', line 37 def sidekiq_retry_in(&block) @sidekiq_retry_in_block = block end |