Module: DropboxApiV2
- Defined in:
- lib/dropbox_api_v2.rb,
lib/dropbox_api_v2/request.rb,
lib/dropbox_api_v2/version.rb,
lib/dropbox_api_v2/response.rb
Defined Under Namespace
Classes: Request, Response
Constant Summary
collapse
- VERSION =
"0.1.7"
Class Method Summary
collapse
-
.download(file_path, token) ⇒ Object
-
.find(path, token, args = {}) ⇒ Object
-
.list_folder(directory_path, token, args = {}) ⇒ Object
-
.list_folder_continue(cursor, token) ⇒ Object
-
.search(file_path, token, args = {}) ⇒ Object
-
.thumbnail(file_path, token, args = {}) ⇒ Object
-
.upload(file_path, token, body) ⇒ Object
Class Method Details
.download(file_path, token) ⇒ Object
18
19
20
|
# File 'lib/dropbox_api_v2.rb', line 18
def self.download(file_path, token)
Request.new("/files/download", path: file_path, file_transfer: true, token: token).response
end
|
.find(path, token, args = {}) ⇒ Object
6
7
8
|
# File 'lib/dropbox_api_v2.rb', line 6
def self.find(path, token, args={})
Request.new("/files/get_metadata", {path: path, token: token}.merge(args)).response
end
|
.list_folder(directory_path, token, args = {}) ⇒ Object
10
11
12
|
# File 'lib/dropbox_api_v2.rb', line 10
def self.list_folder(directory_path, token, args={})
Request.new("/files/list_folder", {path: directory_path, token: token}.merge(args)).response
end
|
.list_folder_continue(cursor, token) ⇒ Object
14
15
16
|
# File 'lib/dropbox_api_v2.rb', line 14
def self.list_folder_continue(cursor, token)
Request.new("/files/list_folder/continue", cursor: cursor, token: token).response
end
|
.search(file_path, token, args = {}) ⇒ Object
26
27
28
|
# File 'lib/dropbox_api_v2.rb', line 26
def self.search(file_path, token, args={})
Request.new("/files/search", {path: file_path, token: token}.merge(args)).response
end
|
.thumbnail(file_path, token, args = {}) ⇒ Object
30
31
32
|
# File 'lib/dropbox_api_v2.rb', line 30
def self.thumbnail(file_path, token, args={})
Request.new("/files/get_thumbnail", {format: "jpeg", size: "w64h64", path: file_path, token: token, file_transfer: true}.merge(args)).response
end
|
.upload(file_path, token, body) ⇒ Object
22
23
24
|
# File 'lib/dropbox_api_v2.rb', line 22
def self.upload(file_path, token, body)
Request.new("/files/upload", path: file_path, body: body, file_transfer: true, token: token, mode: :overwrite, mute: true).response
end
|