Class: ApimaticCalculator::HttpResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/apimatic_calculator/http/http_response.rb

Overview

Http response received.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, reason_phrase, headers, raw_body, request) ⇒ HttpResponse

The constructor

Parameters:

  • The (Integer)

    status code returned by the server.

  • The (String)

    reason phrase returned by the server.

  • The (Hash)

    headers sent by the server in the response.

  • The (String)

    raw body of the response.

  • The (HttpRequest)

    request that resulted in this response.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/apimatic_calculator/http/http_response.rb', line 17

def initialize(status_code,
               reason_phrase,
               headers,
               raw_body,
               request)
  @status_code = status_code
  @reason_phrase = reason_phrase
  @headers = headers
  @raw_body = raw_body
  @request = request
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



9
10
11
# File 'lib/apimatic_calculator/http/http_response.rb', line 9

def headers
  @headers
end

#raw_bodyObject (readonly)

Returns the value of attribute raw_body.



9
10
11
# File 'lib/apimatic_calculator/http/http_response.rb', line 9

def raw_body
  @raw_body
end

#reason_phraseObject (readonly)

Returns the value of attribute reason_phrase.



9
10
11
# File 'lib/apimatic_calculator/http/http_response.rb', line 9

def reason_phrase
  @reason_phrase
end

#requestObject (readonly)

Returns the value of attribute request.



9
10
11
# File 'lib/apimatic_calculator/http/http_response.rb', line 9

def request
  @request
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



9
10
11
# File 'lib/apimatic_calculator/http/http_response.rb', line 9

def status_code
  @status_code
end