Class: Nyauth::ResetPasswordRequest
- Inherits:
-
Object
- Object
- Nyauth::ResetPasswordRequest
- Includes:
- ActiveModel::Model
- Defined in:
- app/services/nyauth/reset_password_request.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
Instance Method Summary collapse
-
#initialize(service_params = {}) ⇒ ResetPasswordRequest
constructor
A new instance of ResetPasswordRequest.
- #save(options = {}) ⇒ Object
Constructor Details
#initialize(service_params = {}) ⇒ ResetPasswordRequest
Returns a new instance of ResetPasswordRequest.
6 7 8 |
# File 'app/services/nyauth/reset_password_request.rb', line 6 def initialize(service_params = {}) @email = service_params[:email] end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'app/services/nyauth/reset_password_request.rb', line 4 def client @client end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
4 5 6 |
# File 'app/services/nyauth/reset_password_request.rb', line 4 def email @email end |
Instance Method Details
#save(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/services/nyauth/reset_password_request.rb', line 10 def save( = {}) .reverse_merge!(as: :user) klass = [:as].to_s.classify.constantize @client = klass.with_given_email(@email).last! @client.request_reset_password rescue errors.add(:base, :invalid_email) end |