Class: Bugno::Filter::Params

Inherits:
Object
  • Object
show all
Defined in:
lib/bugno/filter/params.rb

Constant Summary collapse

SKIPPED_CLASSES =
[::Tempfile].freeze
ATTACHMENT_CLASSES =
%w[ActionDispatch::Http::UploadedFile Rack::Multipart::UploadedFile].freeze
SCRUB_ALL =
:scrub_all

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(*args) ⇒ Object



12
13
14
# File 'lib/bugno/filter/params.rb', line 12

def self.call(*args)
  new.call(*args)
end

.scrub_valueObject



16
17
18
# File 'lib/bugno/filter/params.rb', line 16

def self.scrub_value
  '[FILTERED]'
end

Instance Method Details

#call(options = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/bugno/filter/params.rb', line 20

def call(options = {})
  params = options[:params]
  return {} unless params

  @scrubbed_object_ids = {}

  config = options[:config]
  extra_fields = options[:extra_fields]
  whitelist = options[:whitelist] || []

  scrub(params, build_scrub_options(config, extra_fields, whitelist))
end