Class: Mack::Logging::Filter

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFilter

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

#listObject (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

.listObject



37
38
39
# File 'lib/mack/boot/logging/filter.rb', line 37

def list
  Mack::Logging::Filter.instance.list
end

.remove(*args) ⇒ Object



29
30
31
# File 'lib/mack/boot/logging/filter.rb', line 29

def remove(*args)
  Mack::Logging::Filter.instance.remove(*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