Class: SendGrid::Response
- Inherits:
-
Object
- Object
- SendGrid::Response
- Defined in:
- lib/sendgrid/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#raw_body ⇒ Object
readonly
Returns the value of attribute raw_body.
Instance Method Summary collapse
-
#initialize(params) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(params) ⇒ Response
Returns a new instance of Response.
7 8 9 10 11 12 |
# File 'lib/sendgrid/response.rb', line 7 def initialize(params) @code = params[:code] @headers = params[:headers] @body = JSON.parse(params[:body]) @raw_body = params[:body] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/sendgrid/response.rb', line 5 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/sendgrid/response.rb', line 5 def code @code end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/sendgrid/response.rb', line 5 def headers @headers end |
#raw_body ⇒ Object (readonly)
Returns the value of attribute raw_body.
5 6 7 |
# File 'lib/sendgrid/response.rb', line 5 def raw_body @raw_body end |