Class: Decidim::Votings::SendAccessCode
- Defined in:
- decidim-elections/app/commands/decidim/votings/send_access_code.rb
Overview
A command to send the access code
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(datum, medium) ⇒ SendAccessCode
constructor
A new instance of SendAccessCode.
Methods inherited from Command
call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events
Constructor Details
#initialize(datum, medium) ⇒ SendAccessCode
Returns a new instance of SendAccessCode.
7 8 9 10 |
# File 'decidim-elections/app/commands/decidim/votings/send_access_code.rb', line 7 def initialize(datum, medium) @datum = datum @medium = medium end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Decidim::Command
Instance Method Details
#call ⇒ Object
Executes the command. Broadcast this events:
-
:invalid when params are missing
Returns nothing.
16 17 18 19 20 21 22 |
# File 'decidim-elections/app/commands/decidim/votings/send_access_code.rb', line 16 def call return broadcast(:invalid) unless datum send_access_code broadcast(:ok) end |