Class: Foobara::Auth::CreateResetPasswordToken
- Defined in:
- foobara-auth-0.0.13/src/create_reset_password_token.rb
Constant Summary
Constants included from TruncatedInspect
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#reset_password_token_record ⇒ Object
Returns the value of attribute reset_password_token_record.
-
#reset_password_token_secret ⇒ Object
Returns the value of attribute reset_password_token_secret.
Attributes included from CommandPatternImplementation::Concerns::Subcommands
Attributes included from CommandPatternImplementation::Concerns::Runtime
Attributes included from CommandPatternImplementation::Concerns::Errors
Attributes included from CommandPatternImplementation::Concerns::Inputs
Instance Method Summary collapse
- #determine_timestamps ⇒ Object
- #execute ⇒ Object
- #generate_new_reset_password_token ⇒ Object
- #save_new_reset_password_token_on_user ⇒ Object
Methods inherited from Command
Methods included from Concern
foobara_class_methods_module_for, foobara_concern?, included
Methods included from CommandPatternImplementation::Concerns::Reflection
Methods included from CommandPatternImplementation::Concerns::DomainMappers
#domain_map, #domain_map!, #run_mapped_subcommand!
Methods included from CommandPatternImplementation::Concerns::Subcommands
#run_subcommand!, #subcommand?
Methods included from CommandPatternImplementation::Concerns::Entities
Methods included from CommandPatternImplementation::Concerns::Transactions
Methods included from NestedTransactionable
#auto_detect_current_transactions, #commit_transaction, #commit_transaction_if_open, #open_transaction, #opened_transactions, #relevant_entity_classes, relevant_entity_classes_for_type, #relevant_entity_classes_for_type, #rollback_transaction, #transactions, #use_transaction
Methods included from CommandPatternImplementation::Concerns::StateMachine
Methods included from CommandPatternImplementation::Concerns::Runtime
#halt!, #run, #run!, #run_execute, #succeed, #success?, #validate, #validate_records
Methods included from CommandPatternImplementation::Concerns::Errors
Methods included from CommandPatternImplementation::Concerns::Inputs
#cast_and_validate_inputs, #initialize, #method_missing, #respond_to_missing?, #respond_to_missing_for_inputs?
Methods included from TruncatedInspect
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Foobara::CommandPatternImplementation::Concerns::Inputs
Instance Attribute Details
#expires_at ⇒ Object
Returns the value of attribute expires_at.
26 27 28 |
# File 'foobara-auth-0.0.13/src/create_reset_password_token.rb', line 26 def expires_at @expires_at end |
#reset_password_token_record ⇒ Object
Returns the value of attribute reset_password_token_record.
26 27 28 |
# File 'foobara-auth-0.0.13/src/create_reset_password_token.rb', line 26 def reset_password_token_record @reset_password_token_record end |
#reset_password_token_secret ⇒ Object
Returns the value of attribute reset_password_token_secret.
26 27 28 |
# File 'foobara-auth-0.0.13/src/create_reset_password_token.rb', line 26 def reset_password_token_secret @reset_password_token_secret end |
Instance Method Details
#determine_timestamps ⇒ Object
[View source]
28 29 30 31 |
# File 'foobara-auth-0.0.13/src/create_reset_password_token.rb', line 28 def now = Time.now self.expires_at = now + token_ttl end |
#execute ⇒ Object
[View source]
17 18 19 20 21 22 23 24 |
# File 'foobara-auth-0.0.13/src/create_reset_password_token.rb', line 17 def execute generate_new_reset_password_token save_new_reset_password_token_on_user reset_password_token_secret end |
#generate_new_reset_password_token ⇒ Object
[View source]
33 34 35 36 37 38 |
# File 'foobara-auth-0.0.13/src/create_reset_password_token.rb', line 33 def generate_new_reset_password_token result = run_subcommand!(CreateToken, expires_at:) self.reset_password_token_record = result[:token_record] self.reset_password_token_secret = result[:token_string] end |
#save_new_reset_password_token_on_user ⇒ Object
[View source]
40 41 42 |
# File 'foobara-auth-0.0.13/src/create_reset_password_token.rb', line 40 def save_new_reset_password_token_on_user user.reset_password_token = reset_password_token_record end |