Class: Sidekiq::Tasks::Config

Inherits:
Object
  • Object
show all
Includes:
Validations
Defined in:
lib/sidekiq/tasks/config.rb

Constant Summary collapse

DEFAULT_SIDEKIQ_OPTIONS =
{
  queue: "default",
  retry: false,
}.freeze
DEFAULT_STRATEGIES =
[
  Sidekiq::Tasks::Strategies::RakeTask.new(
    rules: [
      Sidekiq::Tasks::Strategies::Rules::TaskFromLib.new,
      Sidekiq::Tasks::Strategies::Rules::EnableWithComment.new,
    ]
  ),
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validations

validate_array_classes!, validate_class!, validate_expected_values!, validate_hash_option!

Constructor Details

#initializeConfig

Returns a new instance of Config.



22
23
24
25
26
# File 'lib/sidekiq/tasks/config.rb', line 22

def initialize
  @sidekiq_options = DEFAULT_SIDEKIQ_OPTIONS
  @strategies = DEFAULT_STRATEGIES
  @authorization = ->(_env) { true }
end

Instance Attribute Details

#authorizationObject

Returns the value of attribute authorization.



20
21
22
# File 'lib/sidekiq/tasks/config.rb', line 20

def authorization
  @authorization
end

#sidekiq_optionsObject

Returns the value of attribute sidekiq_options.



20
21
22
# File 'lib/sidekiq/tasks/config.rb', line 20

def sidekiq_options
  @sidekiq_options
end

#strategiesObject

Returns the value of attribute strategies.



20
21
22
# File 'lib/sidekiq/tasks/config.rb', line 20

def strategies
  @strategies
end