Module: BWAPI::Client::User

Includes:
Notifications
Included in:
BWAPI::Client
Defined in:
lib/bwapi/client/user.rb,
lib/bwapi/client/user/notifications.rb

Defined Under Namespace

Modules: Notifications

Instance Method Summary collapse

Methods included from Notifications

#delete_notification, #notifications, #update_notification

Instance Method Details

#api_roleString

Get users api role

Returns:

  • (String)

    Users api role



43
44
45
# File 'lib/bwapi/client/user.rb', line 43

def api_role
  user.apiRole
end

#ui_roleString

Get users ui role

Returns:

  • (String)

    Users ui role



50
51
52
# File 'lib/bwapi/client/user.rb', line 50

def ui_role
  user.uiRole
end

#update_user(opts) ⇒ Hashie::Mash

Update the current user

Parameters:

  • opts (Hash)

    options Hash of parameters

Options Hash (opts):

  • id (Integer)

    Id of the user

  • tags (Hash)

    The users assigned tags

  • passwordConfirmation (String)

    The confirmed password

  • enabled (Boolean)

    The status of the user

  • lastName (String)

    The last name of the user

  • phone (String)

    The users phone number

  • department (String)

    The users department

  • job (String)

    The users job

  • messenger (String)

    The users IM details

  • password (String)

    The password of the user

  • clientId (Integer)

    The users client id

  • username (String)

    The users username

  • address (String)

    The users address

  • uiRole (String)

    The users ui role

  • apiRole (Array)

    The users api role

  • firstName (String)

    The users first name

  • mobile (String)

    The users mobile number

  • creationDate (Date)

    Date the user was created on

Returns:

  • (Hashie::Mash)

    Updated user information



36
37
38
# File 'lib/bwapi/client/user.rb', line 36

def update_user opts
  put "user", opts
end

#userHashie::Mash

Get the current user

Returns:

  • (Hashie::Mash)

    User information



10
11
12
# File 'lib/bwapi/client/user.rb', line 10

def user
  get "user"
end