Class: CircuitSwitch::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/circuit_switch/configuration.rb

Constant Summary collapse

CIRCUIT_SWITCH =
'circuit_switch'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#allowed_backtrace_pathsObject



40
41
42
# File 'lib/circuit_switch/configuration.rb', line 40

def allowed_backtrace_paths
  @allowed_backtrace_paths ||= [Dir.pwd]
end

#due_dateObject



32
33
34
# File 'lib/circuit_switch/configuration.rb', line 32

def due_date
  @due_date ||= Date.today + 10
end

#due_date_notifierObject

Returns the value of attribute due_date_notifier.



5
6
7
# File 'lib/circuit_switch/configuration.rb', line 5

def due_date_notifier
  @due_date_notifier
end

#report_ifObject



20
21
22
# File 'lib/circuit_switch/configuration.rb', line 20

def report_if
  @report_if ||= Rails.env.production?
end

#report_pathsObject



8
9
10
# File 'lib/circuit_switch/configuration.rb', line 8

def report_paths
  @report_paths ||= [Rails.root]
end

#reporterObject

Returns the value of attribute reporter.



5
6
7
# File 'lib/circuit_switch/configuration.rb', line 5

def reporter
  @reporter
end

#strip_pathsObject



44
45
46
# File 'lib/circuit_switch/configuration.rb', line 44

def strip_paths
  @strip_paths ||= [Dir.pwd]
end

#with_backtraceObject



36
37
38
# File 'lib/circuit_switch/configuration.rb', line 36

def with_backtrace
  @with_backtrace ||= false
end

Instance Method Details

#enable_report?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/circuit_switch/configuration.rb', line 24

def enable_report?
  report_if.respond_to?(:call) ? report_if.call : !!report_if
end

#key_column_name=(key) ⇒ Object



28
29
30
# File 'lib/circuit_switch/configuration.rb', line 28

def key_column_name=(key)
  ::CircuitSwitch::CircuitSwitch.alias_attribute :key, key
end

#silent_pathsObject



16
17
18
# File 'lib/circuit_switch/configuration.rb', line 16

def silent_paths
  @silent_paths ||= [CIRCUIT_SWITCH]
end

#silent_paths=(paths) ⇒ Object



12
13
14
# File 'lib/circuit_switch/configuration.rb', line 12

def silent_paths=(paths)
  @silent_paths = paths.append(CIRCUIT_SWITCH).uniq
end