Module: Dropbox::API::Fileops

Included in:
Dir, File
Defined in:
lib/dropbox-api/objects/fileops.rb

Instance Method Summary collapse

Instance Method Details

#copy(to, options = {}) ⇒ Object



6
7
8
9
# File 'lib/dropbox-api/objects/fileops.rb', line 6

def copy(to, options = {})
  response = client.raw.copy({ :from_path => self.path, :to_path => to }.merge(options))
  self.update response
end

#destroy(options = {}) ⇒ Object



16
17
18
19
# File 'lib/dropbox-api/objects/fileops.rb', line 16

def destroy(options = {})
  response = client.raw.delete({ :path => self.path }.merge(options))
  self.update response
end

#move(to, options = {}) ⇒ Object



11
12
13
14
# File 'lib/dropbox-api/objects/fileops.rb', line 11

def move(to, options = {})
  response = client.raw.move({ :from_path => self.path, :to_path => to }.merge(options))
  self.update response
end

#pathObject



21
22
23
# File 'lib/dropbox-api/objects/fileops.rb', line 21

def path
  self['path'].sub(/^\//, '')
end