Class: ScoutApm::IgnoredUris

Inherits:
Object
  • Object
show all
Defined in:
lib/scout_apm/ignored_uris.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prefixes) ⇒ IgnoredUris

Returns a new instance of IgnoredUris.



6
7
8
9
# File 'lib/scout_apm/ignored_uris.rb', line 6

def initialize(prefixes)
  regexes = Array(prefixes).map {|prefix| %r{\A#{prefix}} }
  @regex = Regexp.union(*regexes)
end

Instance Attribute Details

#regexObject (readonly)

Returns the value of attribute regex.



4
5
6
# File 'lib/scout_apm/ignored_uris.rb', line 4

def regex
  @regex
end

Instance Method Details

#ignore?(uri) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/scout_apm/ignored_uris.rb', line 11

def ignore?(uri)
  !! regex.match(uri)
end