Class: ViewComponentDevtools::Configuration

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#enabledObject

Returns the value of attribute enabled.



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

def enabled
  @enabled
end

#max_collection_sizeObject

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_depthObject

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_lengthObject

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_keysObject

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

Returns:

  • (Boolean)


30
31
32
# File 'lib/view_component_devtools/configuration.rb', line 30

def enabled_for?(environment)
  enabled && environment.to_s == "development"
end