Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extended parameter list folder #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions lib/dropbox/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,23 @@ def get_thumbnail(path, format='jpeg', size='w64h64')
# Get the contents of a folder.
#
# @param [String] path
# @param [boolean] recursive
# @param [boolean] include_media_info
# @param [boolean] include_deleted
# @param [boolean] include_has_explicit_shared_members
# @return [Array<Dropbox::Metadata>]
def list_folder(path)
resp = request('/files/list_folder', path: path)
def list_folder(path,
recursive = false,
include_media_info = false,
include_deleted = false,
include_has_explicit_shared_members = false )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PascalSenn

how about

def list_folder(path, recursive: false, include_media_info: false, include_deleted: false, include_has_explicit_shared_members: false)
end

?

This way we can explicitly pass the parameters as key-value pairs.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 as this feels more ruby-esque

and bump as I'm in need of the recursive option right now. =P

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resp = request('/files/list_folder',{
path: path,
recursive: recursive,
include_media_info: include_media_info,
include_deleted: include_deleted,
include_has_explicit_shared_members: include_has_explicit_shared_members
})
resp['entries'].map { |e| parse_tagged_response(e) }
end

Expand Down