Class: RightSupport::Notifier::Blacklister::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/right_support/notifiers/blacklisters/base.rb

Overview

base class for a partial data blacklister.

Direct Known Subclasses

Canonical, RegularExpression, Simple, SnakeCase

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Base

Returns a new instance of Base.

Parameters:

  • options (Hash)

Options Hash (options):

  • :replacement_value (Object)

    of any kind including nil. default=‘HIDDEN’.



31
32
33
34
35
36
# File 'lib/right_support/notifiers/blacklisters/base.rb', line 31

def initialize(options)
  options = {
    replacement_value: 'HIDDEN'
  }.merge(options)
  @replacement_value = options[:replacement_value]
end

Instance Attribute Details

#replacement_valueObject (readonly)

Returns the value of attribute replacement_value.



26
27
28
# File 'lib/right_support/notifiers/blacklisters/base.rb', line 26

def replacement_value
  @replacement_value
end

Instance Method Details

#filter(data) ⇒ TrueClass

filters data by finding and replacing blacklisted key patterns with a replacement value.

Parameters:

  • data (Hash)

    for filtering by blacklist

Returns:

  • (TrueClass)

    always true



44
45
46
# File 'lib/right_support/notifiers/blacklisters/base.rb', line 44

def filter(data)
  fail 'Must be overridden'
end