Method: Gitlab::Client::Projects#user_projects

Defined in:
lib/gitlab/client/projects.rb

#user_projects(user_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Get a list of visible projects for the given user.

Examples:

Gitlab.user_projects(1)
Gitlab.user_projects(1, { order_by: 'last_activity_at' })
Gitlab.user_projects('username', { order_by: 'name', sort: 'asc' })

Parameters:

  • user_id (Integer, String)

    The ID or username of the user.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :per_page (String)

    Number of projects to return per page

  • :page (String)

    The page to retrieve

  • :order_by (String)

    Return projects ordered by id, name, path, created_at, updated_at, or last_activity_at fields.

  • :sort (String)

    Return projects sorted in asc or desc order.

Returns:

See Also:


575
576
577
# File 'lib/gitlab/client/projects.rb', line 575

def user_projects(user_id, options = {})
  get("/users/#{url_encode user_id}/projects", query: options)
end