Class: Aha::Auth::User
- Inherits:
-
Object
- Object
- Aha::Auth::User
- Defined in:
- lib/aha/auth/user.rb
Overview
Represents a user from the auth server
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#email_verified ⇒ Object
readonly
Returns the value of attribute email_verified.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
- #full_name ⇒ Object
-
#initialize(attributes = {}) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(attributes = {}) ⇒ User
Returns a new instance of User.
11 12 13 14 15 16 17 18 19 |
# File 'lib/aha/auth/user.rb', line 11 def initialize(attributes = {}) @id = attributes["id"] || attributes[:id] @email = attributes["email"] || attributes[:email] @first_name = attributes["first_name"] || attributes[:first_name] @last_name = attributes["last_name"] || attributes[:last_name] @email_verified = attributes["email_verified"] || attributes[:email_verified] @created_at = parse_time(attributes["created_at"] || attributes[:created_at]) @updated_at = parse_time(attributes["updated_at"] || attributes[:updated_at]) end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
9 10 11 |
# File 'lib/aha/auth/user.rb', line 9 def created_at @created_at end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
9 10 11 |
# File 'lib/aha/auth/user.rb', line 9 def email @email end |
#email_verified ⇒ Object (readonly)
Returns the value of attribute email_verified.
9 10 11 |
# File 'lib/aha/auth/user.rb', line 9 def email_verified @email_verified end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
9 10 11 |
# File 'lib/aha/auth/user.rb', line 9 def first_name @first_name end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/aha/auth/user.rb', line 9 def id @id end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
9 10 11 |
# File 'lib/aha/auth/user.rb', line 9 def last_name @last_name end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
9 10 11 |
# File 'lib/aha/auth/user.rb', line 9 def updated_at @updated_at end |
Instance Method Details
#full_name ⇒ Object
21 22 23 |
# File 'lib/aha/auth/user.rb', line 21 def full_name [first_name, last_name].compact.join(" ") end |