Class: ConciseErrors::Configuration
- Inherits:
-
Object
- Object
- ConciseErrors::Configuration
- Defined in:
- lib/concise_errors/configuration.rb
Overview
Stores global configuration for the middleware.
Constant Summary collapse
- DEFAULT_STACK_LINES =
10- DEFAULT_FORMAT =
:text
Instance Attribute Summary collapse
-
#application_root ⇒ Object
Returns the value of attribute application_root.
-
#cleaner ⇒ Object
Returns the value of attribute cleaner.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#full_error_param ⇒ Object
Returns the value of attribute full_error_param.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#stack_trace_lines ⇒ Object
Returns the value of attribute stack_trace_lines.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
- #format ⇒ Object
- #format=(value) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 |
# File 'lib/concise_errors/configuration.rb', line 11 def initialize reset! end |
Instance Attribute Details
#application_root ⇒ Object
Returns the value of attribute application_root.
9 10 11 |
# File 'lib/concise_errors/configuration.rb', line 9 def application_root @application_root end |
#cleaner ⇒ Object
Returns the value of attribute cleaner.
9 10 11 |
# File 'lib/concise_errors/configuration.rb', line 9 def cleaner @cleaner end |
#enabled ⇒ Object
Returns the value of attribute enabled.
9 10 11 |
# File 'lib/concise_errors/configuration.rb', line 9 def enabled @enabled end |
#full_error_param ⇒ Object
Returns the value of attribute full_error_param.
9 10 11 |
# File 'lib/concise_errors/configuration.rb', line 9 def full_error_param @full_error_param end |
#logger ⇒ Object
Returns the value of attribute logger.
9 10 11 |
# File 'lib/concise_errors/configuration.rb', line 9 def logger @logger end |
#stack_trace_lines ⇒ Object
Returns the value of attribute stack_trace_lines.
9 10 11 |
# File 'lib/concise_errors/configuration.rb', line 9 def stack_trace_lines @stack_trace_lines end |
Instance Method Details
#enabled? ⇒ Boolean
19 20 21 |
# File 'lib/concise_errors/configuration.rb', line 19 def enabled? enabled != false end |
#format ⇒ Object
15 16 17 |
# File 'lib/concise_errors/configuration.rb', line 15 def format (@format || DEFAULT_FORMAT).to_sym end |
#format=(value) ⇒ Object
23 24 25 |
# File 'lib/concise_errors/configuration.rb', line 23 def format=(value) @format = value&.to_sym end |
#reset! ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/concise_errors/configuration.rb', line 27 def reset! @format = :text @stack_trace_lines = DEFAULT_STACK_LINES @enabled = true @logger = nil @application_root = nil @cleaner = nil @full_error_param = "concise_errors_full" end |