Class: Mack::Logging::Filter
- Includes:
- Singleton
- Defined in:
- lib/mack/boot/logging/filter.rb
Overview
Used to house a list of filters for parameter logging. The initial list includes password and password_confirmation
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
The list of parameters you want filtered for logging.
Class Method Summary collapse
Instance Method Summary collapse
-
#add(*args) ⇒ Object
Adds ‘n’ number of parameter names to the list.
-
#initialize ⇒ Filter
constructor
A new instance of Filter.
-
#remove(*args) ⇒ Object
Removes ‘n’ number of parameter names from the list.
Constructor Details
#initialize ⇒ Filter
Returns a new instance of Filter.
12 13 14 |
# File 'lib/mack/boot/logging/filter.rb', line 12 def initialize @list = [:password, :password_confirmation] end |
Instance Attribute Details
#list ⇒ Object (readonly)
The list of parameters you want filtered for logging.
10 11 12 |
# File 'lib/mack/boot/logging/filter.rb', line 10 def list @list end |
Class Method Details
.add(*args) ⇒ Object
33 34 35 |
# File 'lib/mack/boot/logging/filter.rb', line 33 def add(*args) Mack::Logging::Filter.instance.add(*args) end |
Instance Method Details
#add(*args) ⇒ Object
Adds ‘n’ number of parameter names to the list
17 18 19 20 |
# File 'lib/mack/boot/logging/filter.rb', line 17 def add(*args) @list << args @list.flatten! end |
#remove(*args) ⇒ Object
Removes ‘n’ number of parameter names from the list
23 24 25 |
# File 'lib/mack/boot/logging/filter.rb', line 23 def remove(*args) @list = (@list - args) end |