Class: Recorder::Config
- Inherits:
-
Object
- Object
- Recorder::Config
- Includes:
- Singleton
- Defined in:
- lib/recorder/config.rb
Overview
Global configuration options
Instance Attribute Summary collapse
-
#ignore ⇒ Object
Returns the value of attribute ignore.
-
#sidekiq_options ⇒ Object
Returns the value of attribute sidekiq_options.
Instance Method Summary collapse
-
#enabled ⇒ Object
Indicates whether Recorder is on or off.
- #enabled=(enable) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/recorder/config.rb', line 9 def initialize # Variables which affect all threads, whose access is synchronized. @mutex = Mutex.new @enabled = true @sidekiq_options = { :queue => 'recorder', :retry => 10, :backtrace => true } @ignore = Array.new end |
Instance Attribute Details
#ignore ⇒ Object
Returns the value of attribute ignore.
7 8 9 |
# File 'lib/recorder/config.rb', line 7 def ignore @ignore end |
#sidekiq_options ⇒ Object
Returns the value of attribute sidekiq_options.
7 8 9 |
# File 'lib/recorder/config.rb', line 7 def @sidekiq_options end |
Instance Method Details
#enabled ⇒ Object
Indicates whether Recorder is on or off. Default: true.
28 29 30 |
# File 'lib/recorder/config.rb', line 28 def enabled @mutex.synchronize { !!@enabled } end |
#enabled=(enable) ⇒ Object
32 33 34 |
# File 'lib/recorder/config.rb', line 32 def enabled=(enable) @mutex.synchronize { @enabled = enable } end |