Class: Karaden::Net::Response
- Inherits:
-
ResponseInterface
- Object
- ResponseInterface
- Karaden::Net::Response
- Defined in:
- lib/karaden/net/response.rb
Constant Summary collapse
- ERRORS =
{ Karaden::Exception::BadRequestException::STATUS_CODE => Karaden::Exception::BadRequestException, Karaden::Exception::UnauthorizedException::STATUS_CODE => Karaden::Exception::UnauthorizedException, Karaden::Exception::NotFoundException::STATUS_CODE => Karaden::Exception::NotFoundException, Karaden::Exception::ForbiddenException::STATUS_CODE => Karaden::Exception::ForbiddenException, Karaden::Exception::UnprocessableEntityException::STATUS_CODE => Karaden::Exception::UnprocessableEntityException, Karaden::Exception::TooManyRequestsException::STATUS_CODE => Karaden::Exception::TooManyRequestsException }.freeze
Instance Method Summary collapse
- #error ⇒ Object
- #error? ⇒ Boolean
- #headers ⇒ Object
-
#initialize(response, request_options) ⇒ Response
constructor
A new instance of Response.
- #object ⇒ Object
- #status_code ⇒ Object
Constructor Details
#initialize(response, request_options) ⇒ Response
Returns a new instance of Response.
13 14 15 16 17 18 |
# File 'lib/karaden/net/response.rb', line 13 def initialize(response, ) @error = nil @object = nil super() interpret(response, ) end |
Instance Method Details
#error ⇒ Object
20 21 22 |
# File 'lib/karaden/net/response.rb', line 20 def error() @error end |
#error? ⇒ Boolean
36 37 38 |
# File 'lib/karaden/net/response.rb', line 36 def error?() !@error.nil? end |
#headers ⇒ Object
32 33 34 |
# File 'lib/karaden/net/response.rb', line 32 def headers() raise NotImplementedError end |
#object ⇒ Object
24 25 26 |
# File 'lib/karaden/net/response.rb', line 24 def object() @object end |
#status_code ⇒ Object
28 29 30 |
# File 'lib/karaden/net/response.rb', line 28 def status_code() raise NotImplementedError end |