Class: Login::UserCredentialEmailUpdater
- Inherits:
-
Object
- Object
- Login::UserCredentialEmailUpdater
- Defined in:
- app/services/login/user_credential_email_updater.rb
Instance Attribute Summary collapse
-
#credential_email ⇒ Object
readonly
private
Returns the value of attribute credential_email.
-
#user_verification ⇒ Object
readonly
private
Returns the value of attribute user_verification.
Instance Method Summary collapse
-
#initialize(credential_email:, user_verification:) ⇒ UserCredentialEmailUpdater
constructor
A new instance of UserCredentialEmailUpdater.
- #perform ⇒ Object
- #update_user_credential_email ⇒ Object private
Constructor Details
#initialize(credential_email:, user_verification:) ⇒ UserCredentialEmailUpdater
Returns a new instance of UserCredentialEmailUpdater.
5 6 7 8 |
# File 'app/services/login/user_credential_email_updater.rb', line 5 def initialize(credential_email:, user_verification:) @credential_email = credential_email @user_verification = user_verification end |
Instance Attribute Details
#credential_email ⇒ Object (readonly, private)
Returns the value of attribute credential_email.
18 19 20 |
# File 'app/services/login/user_credential_email_updater.rb', line 18 def credential_email @credential_email end |
#user_verification ⇒ Object (readonly, private)
Returns the value of attribute user_verification.
18 19 20 |
# File 'app/services/login/user_credential_email_updater.rb', line 18 def user_verification @user_verification end |
Instance Method Details
#perform ⇒ Object
10 11 12 13 14 |
# File 'app/services/login/user_credential_email_updater.rb', line 10 def perform return unless user_verification && credential_email update_user_credential_email end |
#update_user_credential_email ⇒ Object (private)
20 21 22 23 24 |
# File 'app/services/login/user_credential_email_updater.rb', line 20 def update_user_credential_email user_credential_email = UserCredentialEmail.find_or_initialize_by(user_verification:) user_credential_email.credential_email = credential_email user_credential_email.save! end |