Class: WorkOS::PasswordReset
- Inherits:
-
Object
- Object
- WorkOS::PasswordReset
- Includes:
- HashProvider
- Defined in:
- lib/workos/password_reset.rb
Overview
The PasswordReset class provides a lightweight wrapper around a WorkOS password reset 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.
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#password_reset_token ⇒ Object
Returns the value of attribute password_reset_token.
-
#password_reset_url ⇒ Object
Returns the value of attribute password_reset_url.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(json) ⇒ PasswordReset
constructor
A new instance of PasswordReset.
- #to_json ⇒ Object
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ PasswordReset
Returns a new instance of PasswordReset.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/workos/password_reset.rb', line 13 def initialize(json) hash = JSON.parse(json, symbolize_names: true) @id = hash[:id] @user_id = hash[:user_id] @email = hash[:email] @password_reset_token = hash[:password_reset_token] @password_reset_url = hash[:password_reset_url] @expires_at = hash[:expires_at] @created_at = hash[:created_at] end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/workos/password_reset.rb', line 10 def created_at @created_at end |
#email ⇒ Object
Returns the value of attribute email.
10 11 12 |
# File 'lib/workos/password_reset.rb', line 10 def email @email end |
#expires_at ⇒ Object
Returns the value of attribute expires_at.
10 11 12 |
# File 'lib/workos/password_reset.rb', line 10 def expires_at @expires_at end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/workos/password_reset.rb', line 10 def id @id end |
#password_reset_token ⇒ Object
Returns the value of attribute password_reset_token.
10 11 12 |
# File 'lib/workos/password_reset.rb', line 10 def password_reset_token @password_reset_token end |
#password_reset_url ⇒ Object
Returns the value of attribute password_reset_url.
10 11 12 |
# File 'lib/workos/password_reset.rb', line 10 def password_reset_url @password_reset_url end |
#user_id ⇒ Object
Returns the value of attribute user_id.
10 11 12 |
# File 'lib/workos/password_reset.rb', line 10 def user_id @user_id end |
Instance Method Details
#to_json ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/workos/password_reset.rb', line 25 def to_json(*) { id: id, user_id: user_id, email: email, password_reset_token: password_reset_token, password_reset_url: password_reset_url, expires_at: expires_at, created_at: created_at, } end |