Class: Resque::UniqueInQueue::Configuration
- Inherits:
-
Object
- Object
- Resque::UniqueInQueue::Configuration
- Includes:
- Singleton
- Defined in:
- lib/resque/unique_in_queue/configuration.rb
Constant Summary collapse
- DEFAULT_LOCK_AFTER_EXECUTION_PERIOD =
0- DEFAULT_TTL =
-1- DEFAULT_UNIQUE_IN_QUEUE_KEY_BASE =
'r-uiq'.freeze
- DEFAULT_LOG_LEVEL =
:debug
Instance Attribute Summary collapse
-
#debug_mode ⇒ Object
Returns the value of attribute debug_mode.
-
#lock_after_execution_period ⇒ Object
Returns the value of attribute lock_after_execution_period.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#ttl ⇒ Object
Returns the value of attribute ttl.
-
#unique_in_queue_key_base ⇒ Object
Returns the value of attribute unique_in_queue_key_base.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/resque/unique_in_queue/configuration.rb', line 19 def initialize debug_mode_from_env @lock_after_execution_period = DEFAULT_LOCK_AFTER_EXECUTION_PERIOD @log_level = DEFAULT_LOG_LEVEL @logger = nil @ttl = DEFAULT_TTL @unique_in_queue_key_base = DEFAULT_UNIQUE_IN_QUEUE_KEY_BASE if @debug_mode # Make sure there is a logger when in debug_mode @logger ||= Logger.new(STDOUT) end end |
Instance Attribute Details
#debug_mode ⇒ Object
Returns the value of attribute debug_mode.
12 13 14 |
# File 'lib/resque/unique_in_queue/configuration.rb', line 12 def debug_mode @debug_mode end |
#lock_after_execution_period ⇒ Object
Returns the value of attribute lock_after_execution_period.
12 13 14 |
# File 'lib/resque/unique_in_queue/configuration.rb', line 12 def lock_after_execution_period @lock_after_execution_period end |
#log_level ⇒ Object
Returns the value of attribute log_level.
12 13 14 |
# File 'lib/resque/unique_in_queue/configuration.rb', line 12 def log_level @log_level end |
#logger ⇒ Object
Returns the value of attribute logger.
12 13 14 |
# File 'lib/resque/unique_in_queue/configuration.rb', line 12 def logger @logger end |
#ttl ⇒ Object
Returns the value of attribute ttl.
12 13 14 |
# File 'lib/resque/unique_in_queue/configuration.rb', line 12 def ttl @ttl end |
#unique_in_queue_key_base ⇒ Object
Returns the value of attribute unique_in_queue_key_base.
12 13 14 |
# File 'lib/resque/unique_in_queue/configuration.rb', line 12 def unique_in_queue_key_base @unique_in_queue_key_base end |
Instance Method Details
#to_hash ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/resque/unique_in_queue/configuration.rb', line 32 def to_hash { debug_mode: debug_mode, lock_after_execution_period: lock_after_execution_period, log_level: log_level, logger: logger, ttl: ttl, unique_in_queue_key_base: unique_in_queue_key_base } end |