Module: Sidekiq::Options

Defined in:
lib/sidekiq/options.rb

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



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

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

.[]=(key, value) ⇒ Object



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

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

.configObject



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

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

.options_fieldObject



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

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
  elsif sidekiq_version >= Gem::Version.new('6.5')
    false
  else
    :options
  end
end