Class: Decidim::Votings::SendAccessCode
- Inherits:
-
Command
- Object
- Command
- Decidim::Votings::SendAccessCode
- Defined in:
- 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.
Constructor Details
#initialize(datum, medium) ⇒ SendAccessCode
Returns a new instance of SendAccessCode.
7 8 9 10 |
# File 'app/commands/decidim/votings/send_access_code.rb', line 7 def initialize(datum, medium) @datum = datum @medium = medium end |
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 'app/commands/decidim/votings/send_access_code.rb', line 16 def call return broadcast(:invalid) unless datum send_access_code broadcast(:ok) end |