Class: ExceptionHunter::DataRedacter

Inherits:
Object
  • Object
show all
Defined in:
lib/exception_hunter/data_redacter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params, params_to_filter) ⇒ DataRedacter

Returns a new instance of DataRedacter.



5
6
7
8
# File 'lib/exception_hunter/data_redacter.rb', line 5

def initialize(params, params_to_filter)
  @params = params
  @params_to_filter = params_to_filter
end

Instance Attribute Details

#paramsObject (readonly)



3
4
5
# File 'lib/exception_hunter/data_redacter.rb', line 3

def params
  @params
end

#params_to_filterObject (readonly)



3
4
5
# File 'lib/exception_hunter/data_redacter.rb', line 3

def params_to_filter
  @params_to_filter
end

Instance Method Details

#redactObject



10
11
12
13
14
15
# File 'lib/exception_hunter/data_redacter.rb', line 10

def redact
  return params if params.blank?

  parameter_filter = params_filter.new(params_to_filter)
  parameter_filter.filter(params)
end