Class: CircuitSwitch::Configuration
- Inherits:
-
Object
- Object
- CircuitSwitch::Configuration
- Defined in:
- lib/circuit_switch/configuration.rb
Constant Summary collapse
- CIRCUIT_SWITCH =
'circuit_switch'.freeze
Instance Attribute Summary collapse
- #allowed_backtrace_paths ⇒ Object
- #due_date ⇒ Object
-
#due_date_notifier ⇒ Object
Returns the value of attribute due_date_notifier.
- #report_if ⇒ Object
- #report_paths ⇒ Object
-
#reporter ⇒ Object
Returns the value of attribute reporter.
- #strip_paths ⇒ Object
- #with_backtrace ⇒ Object
Instance Method Summary collapse
- #enable_report? ⇒ Boolean
- #key_column_name=(key) ⇒ Object
- #silent_paths ⇒ Object
- #silent_paths=(paths) ⇒ Object
Instance Attribute Details
#allowed_backtrace_paths ⇒ Object
40 41 42 |
# File 'lib/circuit_switch/configuration.rb', line 40 def allowed_backtrace_paths @allowed_backtrace_paths ||= [Dir.pwd] end |
#due_date ⇒ Object
32 33 34 |
# File 'lib/circuit_switch/configuration.rb', line 32 def due_date @due_date ||= Date.today + 10 end |
#due_date_notifier ⇒ Object
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_if ⇒ Object
20 21 22 |
# File 'lib/circuit_switch/configuration.rb', line 20 def report_if @report_if ||= Rails.env.production? end |
#report_paths ⇒ Object
8 9 10 |
# File 'lib/circuit_switch/configuration.rb', line 8 def report_paths @report_paths ||= [Rails.root] end |
#reporter ⇒ Object
Returns the value of attribute reporter.
5 6 7 |
# File 'lib/circuit_switch/configuration.rb', line 5 def reporter @reporter end |
#strip_paths ⇒ Object
44 45 46 |
# File 'lib/circuit_switch/configuration.rb', line 44 def strip_paths @strip_paths ||= [Dir.pwd] end |
#with_backtrace ⇒ Object
36 37 38 |
# File 'lib/circuit_switch/configuration.rb', line 36 def with_backtrace @with_backtrace ||= false end |
Instance Method Details
#enable_report? ⇒ 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_paths ⇒ Object
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 |