Class: SendGrid::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/sendgrid/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



5
6
7
# File 'lib/sendgrid/response.rb', line 5

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



5
6
7
# File 'lib/sendgrid/response.rb', line 5

def code
  @code
end

#headersObject (readonly)

Returns the value of attribute headers.



5
6
7
# File 'lib/sendgrid/response.rb', line 5

def headers
  @headers
end

#raw_bodyObject (readonly)

Returns the value of attribute raw_body.



5
6
7
# File 'lib/sendgrid/response.rb', line 5

def raw_body
  @raw_body
end