Class: Hello::Business::Management::ResetPassword
- Defined in:
- lib/hello/business/management/reset_password.rb
Instance Attribute Summary collapse
-
#password_credential ⇒ Object
readonly
Returns the value of attribute password_credential.
Instance Method Summary collapse
-
#initialize(password_credential) ⇒ ResetPassword
constructor
A new instance of ResetPassword.
- #update_password(plain_text_password) ⇒ Object
- #user ⇒ Object
Methods inherited from Base
#alert_message, #error_message, #errors, #success_message, #t
Constructor Details
#initialize(password_credential) ⇒ ResetPassword
Returns a new instance of ResetPassword.
7 8 9 |
# File 'lib/hello/business/management/reset_password.rb', line 7 def initialize(password_credential) @password_credential = password_credential end |
Instance Attribute Details
#password_credential ⇒ Object (readonly)
Returns the value of attribute password_credential.
5 6 7 |
# File 'lib/hello/business/management/reset_password.rb', line 5 def password_credential @password_credential end |
Instance Method Details
#update_password(plain_text_password) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/hello/business/management/reset_password.rb', line 11 def update_password(plain_text_password) if @password_credential.update(password: plain_text_password) @password_credential. return true else merge_errors_to_self return false end end |
#user ⇒ Object
21 22 23 |
# File 'lib/hello/business/management/reset_password.rb', line 21 def user password_credential.user end |