Class: Fog::Storage::Dropbox::Files

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/dropbox/models/storage/files.rb

Instance Method Summary collapse

Instance Method Details

#get(key, options = {}, &block) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/fog/dropbox/models/storage/files.rb', line 13

def get(key, options = {}, &block)
  requires :directory

   = service.client.(key)

  new()
rescue DropboxError
  nil
end

#head(key, options = {}) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/fog/dropbox/models/storage/files.rb', line 23

def head(key, options = {})
  requires :directory

   = service.client.(key)

  new()
rescue DropboxError
  nil
end

#new(attributes = {}) ⇒ Object



33
34
35
36
37
# File 'lib/fog/dropbox/models/storage/files.rb', line 33

def new(attributes = {})
  requires :directory
  attributes[:name] = attributes['path'].split('/').last
  super({ :directory => directory }.merge(attributes))
end