Class: RightSupport::Notifier::Blacklister::Simple
- Defined in:
- lib/right_support/notifiers/blacklisters/simple.rb
Overview
implements a simple blacklister that matches a literal top-level key.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#filter(data) ⇒ Object
implements RightSupport::Notifier::Blacklister::Base#filter.
-
#initialize(keys, options = {}) ⇒ Simple
constructor
A new instance of Simple.
Constructor Details
#initialize(keys, options = {}) ⇒ Simple
Returns a new instance of Simple.
32 33 34 35 |
# File 'lib/right_support/notifiers/blacklisters/simple.rb', line 32 def initialize(keys, = {}) super() @keys = ::Set.new(Array(keys).map(&:to_s)) end |
Instance Method Details
#filter(data) ⇒ Object
implements RightSupport::Notifier::Blacklister::Base#filter
38 39 40 41 42 43 44 45 |
# File 'lib/right_support/notifiers/blacklisters/simple.rb', line 38 def filter(data) @keys.each do |key| if data.has_key?(key) data[key] = replacement_value end end true end |