lib/gitlab/client/users.rb
# Creates a new user.
# Requires authentication from an admin account.
#
# @example
#   Gitlab.create_user('joe@foo.org', 'secret', 'joe', { name: 'Joe Smith' })
#   or
#   Gitlab.create_user('joe@foo.org', 'secret')
#
# @param  [String] email The email of a user.
# @param  [String] password The password of a user.
# @param  [String] username The username of a user.
# @param  [Hash] options A customizable set of options.
# @option options [String] :name The name of a user. Defaults to email.
# @option options [String] :skype The skype of a user.
# @option options [String] :linkedin The linkedin of a user.
# @option options [String] :twitter The twitter of a user.
# @option options [Integer] :projects_limit The limit of projects for a user.
# @return [Gitlab::ObjectifiedHash] Information about created user.
Creates a new user.
Requires authentication from an admin account.
Creates a new user . Requires authentication from an admin account .
def create_user(*args)
      options = args.last.is_a?(Hash) ? args.pop : {}
      body = if args[2]
               { email: args[0], password: args[1], username: args[2] }
             else
               { email: args[0], password: args[1], name: args[0] }
             end
      body.merge!(options)
      post('/users', body: body)
    end
def create_user ( * args ) options = args . last . is_a? ( Hash ) ? args . pop : { } body = if args [ 2 ] { email : args [ 0 ] , password : args [ 1 ] , username : args [ 2 ] } else { email : args [ 0 ] , password : args [ 1 ] , name : args [ 0 ] } end body . merge! ( options ) post ( '/users' , body : body ) end
Creates a new user.
Creates a new user .
Information about created user.
Information about created user .
Gitlab::ObjectifiedHash
args
options A customizable set of options.
options A customizable set of options .
options
:projects_limit The limit of projects for a user.
: projects_limit The limit of projects for a user .
example
Gitlab.create_user('joe@foo.org', 'secret', 'joe', { name: 'Joe Smith' }) or Gitlab.create_user('joe@foo.org', 'secret')
Gitlab . create_user ( ' joe@foo . org ' ' secret ' ' joe ' { name : ' Joe Smith ' } ) or Gitlab . create_user ( ' joe@foo . org ' ' secret ' )