Class: Authentise::User
- Inherits:
-
Object
- Object
- Authentise::User
- Defined in:
- lib/authentise/user.rb
Overview
Represents a user that can use the API
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(email: nil, name: nil, username: nil, password: nil) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(email: nil, name: nil, username: nil, password: nil) ⇒ User
Returns a new instance of User.
13 14 15 16 17 18 19 20 21 |
# File 'lib/authentise/user.rb', line 13 def initialize(email: nil, name: nil, username: nil, password: nil) @email = email @name = name @username = username @password = password end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
6 7 8 |
# File 'lib/authentise/user.rb', line 6 def email @email end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/authentise/user.rb', line 6 def name @name end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
6 7 8 |
# File 'lib/authentise/user.rb', line 6 def password @password end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/authentise/user.rb', line 6 def url @url end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
6 7 8 |
# File 'lib/authentise/user.rb', line 6 def username @username end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
6 7 8 |
# File 'lib/authentise/user.rb', line 6 def uuid @uuid end |
Instance Method Details
#create ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/authentise/user.rb', line 23 def create response = API::Users.create_user( email: email, name: name, username: username, password: password, ) @url = response[:url] @uuid = response[:uuid] true end |