Class: Datadog::Tracing::Contrib::StatusCodeMatcher
- Inherits:
-
Object
- Object
- Datadog::Tracing::Contrib::StatusCodeMatcher
- Defined in:
- lib/datadog/tracing/contrib/status_code_matcher.rb
Overview
Contains methods helpful for tracing/annotating HTTP request libraries
Constant Summary collapse
- REGEX_PARSER =
/^\d{3}(?:-\d{3})?(?:,\d{3}(?:-\d{3})?)*$/.freeze
Instance Method Summary collapse
- #include?(exception_status) ⇒ Boolean
-
#initialize(range) ⇒ StatusCodeMatcher
constructor
A new instance of StatusCodeMatcher.
- #to_s ⇒ Object
Constructor Details
#initialize(range) ⇒ StatusCodeMatcher
Returns a new instance of StatusCodeMatcher.
12 13 14 15 |
# File 'lib/datadog/tracing/contrib/status_code_matcher.rb', line 12 def initialize(range) @error_response_range = range set_range end |
Instance Method Details
#include?(exception_status) ⇒ Boolean
17 18 19 |
# File 'lib/datadog/tracing/contrib/status_code_matcher.rb', line 17 def include?(exception_status) set_range.include?(exception_status) end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/datadog/tracing/contrib/status_code_matcher.rb', line 21 def to_s @error_response_range.to_s end |