Class: SendGrid::Response

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

Overview

Holds the response from an API call.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

  • Args :

    • response -> A NET::HTTP response object



12
13
14
# File 'lib/ruby_http_client.rb', line 12

def body
  @body
end

#headersObject (readonly)

  • Args :

    • response -> A NET::HTTP response object



12
13
14
# File 'lib/ruby_http_client.rb', line 12

def headers
  @headers
end

#status_codeObject (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