Class: OpenTrace::Client::UnixSocketResponse
- Inherits:
-
Struct
- Object
- Struct
- OpenTrace::Client::UnixSocketResponse
- Defined in:
- lib/opentrace/client.rb
Overview
Adapts a numeric status code from Unix socket into Net::HTTP response duck type
Instance Method Summary collapse
Instance Method Details
#is_a?(klass) ⇒ Boolean
573 574 575 576 577 578 579 580 581 582 |
# File 'lib/opentrace/client.rb', line 573 def is_a?(klass) c = code.to_i case klass.name when "Net::HTTPSuccess" then c >= 200 && c < 300 when "Net::HTTPTooManyRequests" then c == 429 when "Net::HTTPUnauthorized" then c == 401 when "Net::HTTPServerError" then c >= 500 && c < 600 else super end end |