Class: WithingsAPI::Response

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

Overview

A HTTP Response class.

Instance Method Summary collapse

Constructor Details

#initialize(res) ⇒ WithingsAPI::Response

Initializes a Response object.

Parameters:

  • res (Net::HTTPResponse)
  • res (StringIO)
  • res (Tempfile)


139
140
141
142
143
# File 'lib/withings_api.rb', line 139

def initialize(res)
  @res = res
  @headers = make_headers
  @body = make_body
end

Instance Method Details

#bodyString

Returns HTTP body.

Returns:

  • (String)


156
157
158
# File 'lib/withings_api.rb', line 156

def body
  @body
end

#headersNet::HTTPHeader, Hash

Returns HTTP headers.

Returns:

  • (Net::HTTPHeader)
  • (Hash)


149
150
151
# File 'lib/withings_api.rb', line 149

def headers
  @headers
end