Class: ScoutApm::IgnoredUris
- Inherits:
-
Object
- Object
- ScoutApm::IgnoredUris
- Defined in:
- lib/scout_apm/ignored_uris.rb
Instance Attribute Summary collapse
-
#regex ⇒ Object
readonly
Returns the value of attribute regex.
Instance Method Summary collapse
- #ignore?(uri) ⇒ Boolean
-
#initialize(prefixes) ⇒ IgnoredUris
constructor
A new instance of IgnoredUris.
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
#regex ⇒ Object (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
11 12 13 |
# File 'lib/scout_apm/ignored_uris.rb', line 11 def ignore?(uri) !! regex.match(uri) end |