Class: DropboxApiV2::Response
- Inherits:
-
Object
- Object
- DropboxApiV2::Response
- Defined in:
- lib/dropbox_api_v2/response.rb
Instance Attribute Summary collapse
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
Instance Method Summary collapse
- #body ⇒ Object
- #cursor ⇒ Object
-
#initialize(curl_response) ⇒ Response
constructor
A new instance of Response.
- #json ⇒ Object
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_response ⇒ Object (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
#body ⇒ Object
14 15 16 |
# File 'lib/dropbox_api_v2/response.rb', line 14 def body @raw_response.body end |
#cursor ⇒ Object
18 19 20 |
# File 'lib/dropbox_api_v2/response.rb', line 18 def cursor json["cursor"] end |
#json ⇒ Object
10 11 12 |
# File 'lib/dropbox_api_v2/response.rb', line 10 def json JSON.parse(body) end |