Class: ViewComponentDevtools::Configuration
- Inherits:
-
Object
- Object
- ViewComponentDevtools::Configuration
- Defined in:
- lib/view_component_devtools/configuration.rb
Constant Summary collapse
- DEFAULT_REDACT_KEYS =
[ /authorization/i, /cookie/i, /credential/i, /passw(or)?d/i, /private.?key/i, /secret/i, /session/i, /token/i ].freeze
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#max_collection_size ⇒ Object
Returns the value of attribute max_collection_size.
-
#max_depth ⇒ Object
Returns the value of attribute max_depth.
-
#max_string_length ⇒ Object
Returns the value of attribute max_string_length.
-
#redact_keys ⇒ Object
Returns the value of attribute redact_keys.
Instance Method Summary collapse
- #enabled_for?(environment) ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 27 28 |
# File 'lib/view_component_devtools/configuration.rb', line 22 def initialize @enabled = false @max_depth = 8 @max_collection_size = 50 @max_string_length = 2_000 @redact_keys = DEFAULT_REDACT_KEYS.dup end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
16 17 18 |
# File 'lib/view_component_devtools/configuration.rb', line 16 def enabled @enabled end |
#max_collection_size ⇒ Object
Returns the value of attribute max_collection_size.
16 17 18 |
# File 'lib/view_component_devtools/configuration.rb', line 16 def max_collection_size @max_collection_size end |
#max_depth ⇒ Object
Returns the value of attribute max_depth.
16 17 18 |
# File 'lib/view_component_devtools/configuration.rb', line 16 def max_depth @max_depth end |
#max_string_length ⇒ Object
Returns the value of attribute max_string_length.
16 17 18 |
# File 'lib/view_component_devtools/configuration.rb', line 16 def max_string_length @max_string_length end |
#redact_keys ⇒ Object
Returns the value of attribute redact_keys.
16 17 18 |
# File 'lib/view_component_devtools/configuration.rb', line 16 def redact_keys @redact_keys end |
Instance Method Details
#enabled_for?(environment) ⇒ Boolean
30 31 32 |
# File 'lib/view_component_devtools/configuration.rb', line 30 def enabled_for?(environment) enabled && environment.to_s == "development" end |