Class: Airbrake::Filters::KeysBlocklist Private
- Inherits:
-
Object
- Object
- Airbrake::Filters::KeysBlocklist
- Includes:
- KeysFilter
- Defined in:
- lib/airbrake-ruby/filters/keys_blocklist.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.
A default Airbrake notice filter. Filters only specific keys listed in the list of parameters in the payload of a notice.
Constant Summary
Constants included from KeysFilter
Airbrake::Filters::KeysFilter::FILTERABLE_CONTEXT_KEYS, Airbrake::Filters::KeysFilter::FILTERABLE_KEYS, Airbrake::Filters::KeysFilter::FILTERED, Airbrake::Filters::KeysFilter::VALID_PATTERN_CLASSES
Instance Attribute Summary
Attributes included from KeysFilter
Instance Method Summary collapse
-
#initialize ⇒ KeysBlocklist
constructor
private
A new instance of KeysBlocklist.
-
#should_filter?(key) ⇒ Boolean
private
True if the key matches at least one pattern, false otherwise.
Methods included from KeysFilter
Methods included from Loggable
Constructor Details
#initialize ⇒ KeysBlocklist
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 KeysBlocklist.
31 32 33 34 |
# File 'lib/airbrake-ruby/filters/keys_blocklist.rb', line 31 def initialize(*) super @weight = -110 end |
Instance Method Details
#should_filter?(key) ⇒ Boolean
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 true if the key matches at least one pattern, false otherwise.
38 39 40 41 42 43 44 45 46 |
# File 'lib/airbrake-ruby/filters/keys_blocklist.rb', line 38 def should_filter?(key) @patterns.any? do |pattern| if pattern.is_a?(Regexp) key.match(pattern) else key.to_s == pattern.to_s end end end |