Module: Sidekiq::Options

Defined in:
lib/sidekiq/options.rb

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



4
5
6
# File 'lib/sidekiq/options.rb', line 4

def self.[](key)
  self.config[key]
end

.[]=(key, value) ⇒ Object



8
9
10
# File 'lib/sidekiq/options.rb', line 8

def self.[]=(key, value)
  self.config[key] = value
end

.configObject



12
13
14
# File 'lib/sidekiq/options.rb', line 12

def self.config
  options_field ? Sidekiq.public_send(options_field) : Sidekiq
end

.options_fieldObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/sidekiq/options.rb', line 16

def self.options_field
  return @options_field unless @options_field.nil?

  sidekiq_version = Gem::Version.new(Sidekiq::VERSION)
  @options_field = if sidekiq_version >= Gem::Version.new('7.0')
    :default_configuration
  else
    false
  end
end