Class: DropboxApiV2::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(curl_response) ⇒ Response

Returns a new instance of Response.



6
7
8
# File 'lib/dropbox_api_v2/response.rb', line 6

def initialize(curl_response)
  @raw_response = curl_response
end

Instance Attribute Details

#raw_responseObject (readonly)

Returns the value of attribute raw_response.



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

def raw_response
  @raw_response
end

Instance Method Details

#bodyObject



14
15
16
# File 'lib/dropbox_api_v2/response.rb', line 14

def body
  @raw_response.body
end

#cursorObject



18
19
20
# File 'lib/dropbox_api_v2/response.rb', line 18

def cursor
  json["cursor"]
end

#jsonObject



10
11
12
# File 'lib/dropbox_api_v2/response.rb', line 10

def json
  JSON.parse(body)
end