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.4"

Class Method Summary collapse

Class Method Details

.download(file_path, token) ⇒ Object



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

def self.download(file_path, token)
  Request.new("/files/download", path: file_path, file_transfer: true, token: token).response
end

.list_folder(directory_path, token, args = {}) ⇒ Object



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

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



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

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



21
22
23
# File 'lib/dropbox_api_v2.rb', line 21

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



25
26
27
# File 'lib/dropbox_api_v2.rb', line 25

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



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

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