Class: Dropbox::Explorer::Client
- Inherits:
-
Object
- Object
- Dropbox::Explorer::Client
- Defined in:
- lib/dropbox/explorer/client.rb
Instance Method Summary collapse
- #contents_in_path(path = '/', options = {}) ⇒ Object
- #get_file_content(file_path) ⇒ Object
- #get_file_url(file_path) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 |
# File 'lib/dropbox/explorer/client.rb', line 6 def initialize( = {}) @options = @options[:credentials] = fetch_credentials @dropbox_client = init_dropbox_client end |
Instance Method Details
#contents_in_path(path = '/', options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/dropbox/explorer/client.rb', line 13 def contents_in_path(path = '/', = {}) = @dropbox_client.(path) Folder.new().get_contents_paths(only_files: [:only_files]) end |
#get_file_content(file_path) ⇒ Object
18 19 20 21 |
# File 'lib/dropbox/explorer/client.rb', line 18 def get_file_content(file_path) content, = @dropbox_client.(file_path) content end |
#get_file_url(file_path) ⇒ Object
23 24 25 26 |
# File 'lib/dropbox/explorer/client.rb', line 23 def get_file_url(file_path) generated_url = @dropbox_client.media(file_path) generated_url['url'] end |