module Dropbox::Client

Public Instance Methods

default_root() click to toggle source
# File lib/rest-core/client/dropbox.rb, line 74
def default_root
  'sandbox'
end
download(path, query={}) click to toggle source
# File lib/rest-core/client/dropbox.rb, line 78
def download path, query={}, opts={}, &cb
  get("https://content.dropboxapi.com/1/files/#{root}/#{path}",
      query, {:json_response => false}.merge(opts), &cb)
end
ls(path='', query={}) { |map{ |c| c }| ... } click to toggle source
# File lib/rest-core/client/dropbox.rb, line 88
def ls path='', query={}, opts={}
  args = ["1/metadata/#{root}/#{path}", query, opts]
  if block_given?
    get(*args){ |r| yield(r['contents'].map{ |c| c['path'] }) }
  else
    get(*args)['contents'].map{ |c| c['path'] }
  end
end
me(query={}) click to toggle source
# File lib/rest-core/client/dropbox.rb, line 70
def me query={}, opts={}, &cb
  get('1/account/info', query, opts, &cb)
end
upload(path, file, query={}) click to toggle source
# File lib/rest-core/client/dropbox.rb, line 83
def upload path, file, query={}, opts={}, &cb
  put("https://content.dropboxapi.com/1/files_put/#{root}/#{path}",
      file, query, opts, &cb)
end