Class: Errordeck::Scrubber::Url

Inherits:
Object
  • Object
show all
Defined in:
lib/errordeck/scrubber/url.rb

Instance Method Summary collapse

Constructor Details

#initialize(url, filter = nil) ⇒ Url

Returns a new instance of Url.



6
7
8
9
# File 'lib/errordeck/scrubber/url.rb', line 6

def initialize(url, filter = nil)
  @url = url
  @filter = filter || Errordeck::Scrubber::SENSITIVE_PARAMS
end

Instance Method Details

#scrubObject

remove sensitive data from url



12
13
14
15
16
# File 'lib/errordeck/scrubber/url.rb', line 12

def scrub
  uri = URI.parse(@url)
  uri.query = Errordeck::Scrubber::QueryParam.new(uri.query, @filter).scrub
  uri.to_s
end