Class: Datadog::Tracing::Contrib::StatusCodeMatcher

Inherits:
Object
  • Object
show all
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

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

Returns:

  • (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_sObject



21
22
23
# File 'lib/datadog/tracing/contrib/status_code_matcher.rb', line 21

def to_s
  @error_response_range.to_s
end