Class: ZeusClient::V1::User
- Inherits:
-
Object
- Object
- ZeusClient::V1::User
- Defined in:
- lib/zeus/v1/client/models/auth/user.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#email ⇒ Object
Returns the value of attribute email.
-
#email_verified ⇒ Object
Returns the value of attribute email_verified.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(user) ⇒ User
constructor
A new instance of User.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(user) ⇒ User
Returns a new instance of User.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/zeus/v1/client/models/auth/user.rb', line 5 def initialize(user) return if user.blank? self.id = user["id"] if user.has_key?("id") self.name = user["name"] if user.has_key?("name") self.first_name = user["first_name"] if user.has_key?("first_name") self.last_name = user["last_name"] if user.has_key?("last_name") self.email = user["email"] if user.has_key?("email") self.email_verified = user["email_verified"] if user.has_key?("email_verified") self.created_at = user["created_at"] if user.has_key?("created_at") self.updated_at = user["updated_at"] if user.has_key?("updated_at") end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/zeus/v1/client/models/auth/user.rb', line 3 def created_at @created_at end |
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/zeus/v1/client/models/auth/user.rb', line 3 def email @email end |
#email_verified ⇒ Object
Returns the value of attribute email_verified.
3 4 5 |
# File 'lib/zeus/v1/client/models/auth/user.rb', line 3 def email_verified @email_verified end |
#first_name ⇒ Object
Returns the value of attribute first_name.
3 4 5 |
# File 'lib/zeus/v1/client/models/auth/user.rb', line 3 def first_name @first_name end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/zeus/v1/client/models/auth/user.rb', line 3 def id @id end |
#last_name ⇒ Object
Returns the value of attribute last_name.
3 4 5 |
# File 'lib/zeus/v1/client/models/auth/user.rb', line 3 def last_name @last_name end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/zeus/v1/client/models/auth/user.rb', line 3 def name @name end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/zeus/v1/client/models/auth/user.rb', line 3 def updated_at @updated_at end |
Instance Method Details
#as_json(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/zeus/v1/client/models/auth/user.rb', line 17 def as_json(={}) { id: self.id, name: self.name, first_name: self.first_name, last_name: self.last_name, email: self.email, email_verified: self.email_verified, created_at: self.created_at, updated_at: self.updated_at } end |
#to_json(options = {}) ⇒ Object
30 31 32 |
# File 'lib/zeus/v1/client/models/auth/user.rb', line 30 def to_json(={}) self.as_json().to_json end |