Class: WorkOS::User
Overview
The User class provides a lightweight wrapper around a WorkOS User resource. This class is not meant to be instantiated in a user space, and is instantiated internally but exposed.
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.
-
#last_sign_in_at ⇒ Object
Returns the value of attribute last_sign_in_at.
-
#profile_picture_url ⇒ Object
Returns the value of attribute profile_picture_url.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(json) ⇒ User
constructor
A new instance of User.
- #to_json ⇒ Object
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ User
Returns a new instance of User.
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/workos/user.rb', line 13 def initialize(json) hash = JSON.parse(json, symbolize_names: true) @id = hash[:id] @email = hash[:email] @first_name = hash[:first_name] @last_name = hash[:last_name] @email_verified = hash[:email_verified] @profile_picture_url = hash[:profile_picture_url] @last_sign_in_at = hash[:last_sign_in_at] @created_at = hash[:created_at] @updated_at = hash[:updated_at] end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/workos/user.rb', line 10 def created_at @created_at end |
#email ⇒ Object
Returns the value of attribute email.
10 11 12 |
# File 'lib/workos/user.rb', line 10 def email @email end |
#email_verified ⇒ Object
Returns the value of attribute email_verified.
10 11 12 |
# File 'lib/workos/user.rb', line 10 def email_verified @email_verified end |
#first_name ⇒ Object
Returns the value of attribute first_name.
10 11 12 |
# File 'lib/workos/user.rb', line 10 def first_name @first_name end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/workos/user.rb', line 10 def id @id end |
#last_name ⇒ Object
Returns the value of attribute last_name.
10 11 12 |
# File 'lib/workos/user.rb', line 10 def last_name @last_name end |
#last_sign_in_at ⇒ Object
Returns the value of attribute last_sign_in_at.
10 11 12 |
# File 'lib/workos/user.rb', line 10 def last_sign_in_at @last_sign_in_at end |
#profile_picture_url ⇒ Object
Returns the value of attribute profile_picture_url.
10 11 12 |
# File 'lib/workos/user.rb', line 10 def profile_picture_url @profile_picture_url end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
10 11 12 |
# File 'lib/workos/user.rb', line 10 def updated_at @updated_at end |
Instance Method Details
#to_json ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/workos/user.rb', line 27 def to_json(*) { id: id, email: email, first_name: first_name, last_name: last_name, email_verified: email_verified, profile_picture_url: profile_picture_url, last_sign_in_at: last_sign_in_at, created_at: created_at, updated_at: updated_at, } end |