gitlabhq/lib/api/users.rb
Robert Speicher 7754189187 Fully embrace Ruby 1.9 hash syntax
Didn't bother with files in db/, config/, or features/
2012-08-10 18:25:15 -04:00

37 lines
722 B
Ruby

module Gitlab
# Users API
class Users < Grape::API
before { authenticate! }
resource :users do
# Get a users list
#
# Example Request:
# GET /users
get do
@users = User.all
present @users, with: Entities::User
end
# Get a single user
#
# Parameters:
# id (required) - The ID of a user
# Example Request:
# GET /users/:id
get ":id" do
@user = User.find(params[:id])
present @user, with: Entities::User
end
end
# Get currently authenticated user
#
# Example Request:
# GET /user
get "/user" do
present @current_user, with: Entities::User
end
end
end