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)


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

property :email, type: String, required: true

#first_nameString

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

Returns:

  • (String)


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

property :first_name, type: String

#idInteger

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

Returns:

  • (Integer)


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

property :id, type: Integer

#last_nameString

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

Returns:

  • (String)


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

property :last_name, type: String

#organization_nameString

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

Returns:

  • (String)


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

property :organization_name, type: String

#passwordString

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

Returns:

  • (String)


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

property :password, type: String

#password_confirmationString

The user’s password_confirmation.

Returns:

  • (String)


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

property :password_confirmation, type: String

#phone_numberString

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

Returns:

  • (String)


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

property :phone_number, type: String

#rolesArray<G5AuthenticationClient::Role>

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

Returns:



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

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)


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

property :title, type: String

Instance Method Details

#validate_for_create!Object

Raises:

  • (ArgumentError)


72
73
74
75
# File 'lib/g5_authentication_client/user.rb', line 72

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