Class: CacheInspector::Config
- Inherits:
-
Object
- Object
- CacheInspector::Config
- Defined in:
- lib/cache_inspector/config.rb
Instance Attribute Summary collapse
-
#enabled_environments ⇒ Object
Returns the value of attribute enabled_environments.
-
#log_payloads ⇒ Object
Returns the value of attribute log_payloads.
-
#log_prefix ⇒ Object
Returns the value of attribute log_prefix.
-
#warn_large_size_kb ⇒ Object
Returns the value of attribute warn_large_size_kb.
Instance Method Summary collapse
- #enabled?(env) ⇒ Boolean
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
6 7 8 9 10 11 |
# File 'lib/cache_inspector/config.rb', line 6 def initialize @enabled_environments = %i[development test] @log_prefix = "[CacheInspector]" @warn_large_size_kb = 100 # warn if payload > 100 KB @log_payloads = false end |
Instance Attribute Details
#enabled_environments ⇒ Object
Returns the value of attribute enabled_environments.
4 5 6 |
# File 'lib/cache_inspector/config.rb', line 4 def enabled_environments @enabled_environments end |
#log_payloads ⇒ Object
Returns the value of attribute log_payloads.
4 5 6 |
# File 'lib/cache_inspector/config.rb', line 4 def log_payloads @log_payloads end |
#log_prefix ⇒ Object
Returns the value of attribute log_prefix.
4 5 6 |
# File 'lib/cache_inspector/config.rb', line 4 def log_prefix @log_prefix end |
#warn_large_size_kb ⇒ Object
Returns the value of attribute warn_large_size_kb.
4 5 6 |
# File 'lib/cache_inspector/config.rb', line 4 def warn_large_size_kb @warn_large_size_kb end |
Instance Method Details
#enabled?(env) ⇒ Boolean
13 14 15 |
# File 'lib/cache_inspector/config.rb', line 13 def enabled?(env) @enabled_environments.map(&:to_sym).include?(env.to_sym) end |