Class: SendGrid::Response
- Inherits:
-
Object
- Object
- SendGrid::Response
- Defined in:
- lib/ruby_http_client.rb
Overview
Holds the response from an API call.
Instance Attribute Summary collapse
-
#response_body ⇒ Object
readonly
-
Args : -
response-> A NET::HTTP response object.
-
-
#response_headers ⇒ Object
readonly
-
Args : -
response-> A NET::HTTP response object.
-
-
#status_code ⇒ Object
readonly
-
Args : -
response-> A NET::HTTP response object.
-
Instance Method Summary collapse
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
24 25 26 27 28 |
# File 'lib/ruby_http_client.rb', line 24 def initialize(response) @status_code = response.code @response_body = response.body @response_headers = response.to_hash.inspect end |
Instance Attribute Details
#response_body ⇒ Object (readonly)
-
Args :
-
response-> A NET::HTTP response object
-
23 24 25 |
# File 'lib/ruby_http_client.rb', line 23 def response_body @response_body end |
#response_headers ⇒ Object (readonly)
-
Args :
-
response-> A NET::HTTP response object
-
23 24 25 |
# File 'lib/ruby_http_client.rb', line 23 def response_headers @response_headers end |
#status_code ⇒ Object (readonly)
-
Args :
-
response-> A NET::HTTP response object
-
23 24 25 |
# File 'lib/ruby_http_client.rb', line 23 def status_code @status_code end |