Class: G5AuthenticationClient::User

Inherits:
Modelish::Base
  • Object
show all
Defined in:
lib/g5_authentication_client/user.rb

Overview

A G5 Authentication User

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#emailString

The user’s email address.

Returns:

  • (String)


12
# File 'lib/g5_authentication_client/user.rb', line 12

property :email, type: String, required: true

#first_nameString

The user’s first name. Not required to create a user.

Returns:

  • (String)


32
# File 'lib/g5_authentication_client/user.rb', line 32

property :first_name, type: String

#idInteger

The user’s id. Not required to create a user.

Returns:

  • (Integer)


27
# File 'lib/g5_authentication_client/user.rb', line 27

property :id, type: Integer

#last_nameString

The user’s last name. Not required to create a user.

Returns:

  • (String)


37
# File 'lib/g5_authentication_client/user.rb', line 37

property :last_name, type: String

#organization_nameString

The user’s organization name. Not required to create a user.

Returns:

  • (String)


47
# File 'lib/g5_authentication_client/user.rb', line 47

property :organization_name, type: String

#passwordString

The user’s password. Required to create a user.

Returns:

  • (String)


17
# File 'lib/g5_authentication_client/user.rb', line 17

property :password, type: String

#password_confirmationString

The user’s password_confirmation.

Returns:

  • (String)


22
# File 'lib/g5_authentication_client/user.rb', line 22

property :password_confirmation, type: String

#phone_numberString

The user’s phone number. Not required to create a user.

Returns:

  • (String)


52
# File 'lib/g5_authentication_client/user.rb', line 52

property :phone_number, type: String

#rolesArray<G5AuthenticationClient::Role>

The user’s roles. Not required to create a user.

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/g5_authentication_client/user.rb', line 57

property :roles, default: [],
type: proc { |val|
  val.map { |r|
    Role.new(r)
  }
},
validator: proc { |val|
  "User roles must be valid" if val &&
    val.detect { |r|
      !r.valid?
    }
}

#titleString

The user’s title. Not required to create a user.

Returns:

  • (String)


42
# File 'lib/g5_authentication_client/user.rb', line 42

property :title, type: String

Instance Method Details

#validate_for_create!Object

Raises:

  • (ArgumentError)


70
71
72
73
# File 'lib/g5_authentication_client/user.rb', line 70

def validate_for_create!
  validate!
  raise ArgumentError.new("Password required for new user.") unless !password.nil?
end