Class: Dropbox::API::Dir

Inherits:
Object
  • Object
show all
Includes:
Fileops
Defined in:
lib/dropbox-api/objects/dir.rb

Instance Attribute Summary

Attributes inherited from Object

#client

Instance Method Summary collapse

Methods included from Fileops

#copy, #destroy, #move, #path

Methods inherited from Object

convert, #deep_update, init, resolve_class

Instance Method Details

#ls(path_to_list = '') ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/dropbox-api/objects/dir.rb', line 8

def ls(path_to_list = '')
  data = client.raw. :path => path + path_to_list
  if data['is_dir']
    Dropbox::API::Object.convert(data.delete('contents') || [], client)
  else
    [Dropbox::API::Object.convert(data, client)]
  end
end