Module: Resque::UniqueInQueue
- Defined in:
- lib/resque-unique_in_queue.rb,
lib/resque/unique_in_queue.rb,
lib/resque/unique_in_queue/queue.rb,
lib/resque/unique_in_queue/version.rb,
lib/resque/unique_in_queue/configuration.rb,
sig/resque/unique_in_queue.rbs
Defined Under Namespace
Modules: Queue, Version Classes: Configuration
Constant Summary collapse
- PLUGIN_TAG =
blue_text("[R-UIQ] ").freeze
- VERSION =
Current gem version exposed at the traditional constant location.
Version::VERSION
Class Attribute Summary collapse
-
.configuration ⇒ Object
The plugin exposes one replaceable configuration object by design.
Class Method Summary collapse
-
.blue_text(text) ⇒ Object
Wraps text in ANSI blue escape codes.
- .debug(message) ⇒ Object
- .log(message) ⇒ Object
Instance Method Summary collapse
-
#configure {|@configuration| ... } ⇒ Object
For per-class config with a block.
Class Attribute Details
.configuration ⇒ Object
The plugin exposes one replaceable configuration object by design. rubocop:disable ThreadSafety/ClassAndModuleAttributes
50 51 52 |
# File 'lib/resque-unique_in_queue.rb', line 50 def configuration @configuration end |
Class Method Details
.blue_text(text) ⇒ Object
Wraps text in ANSI blue escape codes. Replaces the former colorize
dependency; produces the exact sequence colorize's String#blue emitted.
27 28 29 |
# File 'lib/resque-unique_in_queue.rb', line 27 def self.blue_text(text) "\e[0;34;49m#{text}\e[0m" end |
.debug(message) ⇒ Object
37 38 39 |
# File 'lib/resque-unique_in_queue.rb', line 37 def debug() configuration.logger&.debug("#{PLUGIN_TAG}#{}") if configuration.debug_mode end |
.log(message) ⇒ Object
33 34 35 |
# File 'lib/resque-unique_in_queue.rb', line 33 def log() configuration.logger&.send(configuration.log_level, ) end |
Instance Method Details
#configure {|@configuration| ... } ⇒ Object
For per-class config with a block
42 43 44 |
# File 'lib/resque-unique_in_queue.rb', line 42 def configure yield(@configuration) end |