From 35aadef3f321d4d700c3f7926f2206ac241e7191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=B5=20Anh=20Duy?= Date: Sun, 9 Feb 2014 16:51:48 +0700 Subject: [PATCH] scope for projects api --- lib/gitlab/client/projects.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/client/projects.rb b/lib/gitlab/client/projects.rb index 88c8a7f6d..a3cfce2e1 100644 --- a/lib/gitlab/client/projects.rb +++ b/lib/gitlab/client/projects.rb @@ -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] 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.