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
-
#body ⇒ Object
readonly
-
Args : -
response
-> A NET::HTTP response object.
-
-
#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.
13 14 15 16 17 |
# File 'lib/ruby_http_client.rb', line 13 def initialize(response) @status_code = response.code @body = response.body @headers = response.to_hash end |
Instance Attribute Details
#body ⇒ Object (readonly)
-
Args :
-
response
-> A NET::HTTP response object
-
12 13 14 |
# File 'lib/ruby_http_client.rb', line 12 def body @body end |
#headers ⇒ Object (readonly)
-
Args :
-
response
-> A NET::HTTP response object
-
12 13 14 |
# File 'lib/ruby_http_client.rb', line 12 def headers @headers end |
#status_code ⇒ Object (readonly)
-
Args :
-
response
-> A NET::HTTP response object
-
12 13 14 |
# File 'lib/ruby_http_client.rb', line 12 def status_code @status_code end |