Class: Decidim::Votings::Admin::DestroyBallotStyle
- Defined in:
- decidim-elections/app/commands/decidim/votings/admin/destroy_ballot_style.rb
Overview
A command with the business logic to delete the ballot style
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(ballot_style, current_user) ⇒ DestroyBallotStyle
constructor
A new instance of DestroyBallotStyle.
Methods inherited from Command
call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events
Constructor Details
#initialize(ballot_style, current_user) ⇒ DestroyBallotStyle
Returns a new instance of DestroyBallotStyle.
8 9 10 11 |
# File 'decidim-elections/app/commands/decidim/votings/admin/destroy_ballot_style.rb', line 8 def initialize(ballot_style, current_user) @ballot_style = ballot_style @current_user = current_user 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:
-
:ok when everything is valid
-
:invalid when the form was not valid and could not proceed
Returns nothing.
18 19 20 21 22 |
# File 'decidim-elections/app/commands/decidim/votings/admin/destroy_ballot_style.rb', line 18 def call destroy_ballot_style! broadcast(:ok) end |