Class: Hanami::Logger::Formatter::HashFilter Private
- Inherits:
-
Object
- Object
- Hanami::Logger::Formatter::HashFilter
- Defined in:
- lib/hanami/logger.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Filtering logic
Instance Attribute Summary collapse
- #filters ⇒ Object readonly private
Instance Method Summary collapse
- #filter(hash) ⇒ Object private
-
#initialize(filters = []) ⇒ HashFilter
constructor
private
A new instance of HashFilter.
Constructor Details
#initialize(filters = []) ⇒ HashFilter
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of HashFilter.
239 240 241 |
# File 'lib/hanami/logger.rb', line 239 def initialize(filters = []) @filters = filters end |
Instance Attribute Details
#filters ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
235 236 237 |
# File 'lib/hanami/logger.rb', line 235 def filters @filters end |
Instance Method Details
#filter(hash) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
245 246 247 248 249 250 251 252 |
# File 'lib/hanami/logger.rb', line 245 def filter(hash) _filtered_keys(hash).each do |key| *keys, last = _actual_keys(hash, key.split('.')) keys.inject(hash, :fetch)[last] = '[FILTERED]' end hash end |