Class: Recorder::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/recorder/config.rb

Overview

Global configuration options

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

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

#ignoreObject

Returns the value of attribute ignore.



7
8
9
# File 'lib/recorder/config.rb', line 7

def ignore
  @ignore
end

#sidekiq_optionsObject

Returns the value of attribute sidekiq_options.



7
8
9
# File 'lib/recorder/config.rb', line 7

def sidekiq_options
  @sidekiq_options
end

Instance Method Details

#enabledObject

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