Class: Decidim::Verifications::IdDocuments::Admin::ConfirmUserOfflineAuthorization
- Inherits:
-
Command
- Object
- Command
- Decidim::Verifications::IdDocuments::Admin::ConfirmUserOfflineAuthorization
- Defined in:
- app/commands/decidim/verifications/id_documents/admin/confirm_user_offline_authorization.rb
Overview
A command to confirm a previous partial offline authorization.
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(form) ⇒ ConfirmUserOfflineAuthorization
constructor
Public: Initializes the command.
Constructor Details
#initialize(form) ⇒ ConfirmUserOfflineAuthorization
Public: Initializes the command.
form - A form object with the verification data to confirm it.
12 13 14 |
# File 'app/commands/decidim/verifications/id_documents/admin/confirm_user_offline_authorization.rb', line 12 def initialize(form) @form = form end |
Instance Method Details
#call ⇒ Object
Executes the command. Broadcasts these events:
-
:ok when everything is valid.
-
:invalid if the handler was not valid and we could not proceed.
Returns nothing.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/commands/decidim/verifications/id_documents/admin/confirm_user_offline_authorization.rb', line 22 def call return broadcast(:invalid) unless form.valid? return broadcast(:invalid) unless if confirmation_successful? broadcast(:ok) else broadcast(:invalid) end end |