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



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/recorder/config.rb', line 12

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 = []
  @async = false
end

Instance Attribute Details

#asyncObject

Returns the value of attribute async.



10
11
12
# File 'lib/recorder/config.rb', line 10

def async
  @async
end

#ignoreObject

Returns the value of attribute ignore.



10
11
12
# File 'lib/recorder/config.rb', line 10

def ignore
  @ignore
end

#sidekiq_optionsObject

Returns the value of attribute sidekiq_options.



9
10
11
# File 'lib/recorder/config.rb', line 9

def sidekiq_options
  @sidekiq_options
end

Instance Method Details

#enabledObject

Indicates whether Recorder is on or off. Default: true.



36
37
38
# File 'lib/recorder/config.rb', line 36

def enabled
  @mutex.synchronize { !!@enabled }
end

#enabled=(enable) ⇒ Object



40
41
42
# File 'lib/recorder/config.rb', line 40

def enabled=(enable)
  @mutex.synchronize { @enabled = enable }
end