Skip to content

Commit

Permalink
scope for projects api
Browse files Browse the repository at this point in the history
  • Loading branch information
Võ Anh Duy committed Feb 9, 2014
1 parent 5877e24 commit 35aadef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/gitlab/client/projects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ module Projects
# @param [Hash] options A customizable set of options.
# @option options [Integer] :page The page number.
# @option options [Integer] :per_page The number of results per page.
# @option options [String] :scope Scope of projects. 'owned' for list of projects owned by the authenticated user, 'all' to get all projects (admin only)
# @return [Array<Gitlab::ObjectifiedHash>]
def projects(options={})
get("/projects", :query => options)
if (options[:scope])
get("/projects/#{options[:scope]}", :query => options)
else
get("/projects", :query => options)
end
end

# Gets information about a project.
Expand Down

0 comments on commit 35aadef

Please sign in to comment.