Class: ZeusSdk::V1::User
- Inherits:
-
Object
- Object
- ZeusSdk::V1::User
- Defined in:
- lib/zeus_sdk/v1/models/auth/user.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#deleted_at ⇒ Object
Returns the value of attribute deleted_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.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#touched_at ⇒ Object
Returns the value of attribute touched_at.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
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 16 17 18 |
# File 'lib/zeus_sdk/v1/models/auth/user.rb', line 5 def initialize(user) return if user.blank? self.raw = user self.user_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") self.touched_at = user["touched_at"] if user.has_key?("touched_at") self.deleted_at = user["deleted_at"] if user.has_key?("deleted_at") end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/zeus_sdk/v1/models/auth/user.rb', line 3 def created_at @created_at end |
#deleted_at ⇒ Object
Returns the value of attribute deleted_at.
3 4 5 |
# File 'lib/zeus_sdk/v1/models/auth/user.rb', line 3 def deleted_at @deleted_at end |
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/zeus_sdk/v1/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_sdk/v1/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_sdk/v1/models/auth/user.rb', line 3 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
3 4 5 |
# File 'lib/zeus_sdk/v1/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_sdk/v1/models/auth/user.rb', line 3 def name @name end |
#raw ⇒ Object
Returns the value of attribute raw.
3 4 5 |
# File 'lib/zeus_sdk/v1/models/auth/user.rb', line 3 def raw @raw end |
#touched_at ⇒ Object
Returns the value of attribute touched_at.
3 4 5 |
# File 'lib/zeus_sdk/v1/models/auth/user.rb', line 3 def touched_at @touched_at end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/zeus_sdk/v1/models/auth/user.rb', line 3 def updated_at @updated_at end |
#user_id ⇒ Object
Returns the value of attribute user_id.
3 4 5 |
# File 'lib/zeus_sdk/v1/models/auth/user.rb', line 3 def user_id @user_id end |
Instance Method Details
#as_json(options = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/zeus_sdk/v1/models/auth/user.rb', line 20 def as_json(={}) { id: self.user_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, touched_at: self.touched_at, deleted_at: self.deleted_at } end |
#to_json(options = {}) ⇒ Object
35 36 37 |
# File 'lib/zeus_sdk/v1/models/auth/user.rb', line 35 def to_json(={}) self.as_json().to_json end |