Class: Decidim::Votings::Admin::DestroyBallotStyle
- Inherits:
-
Command
- Object
- Command
- 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.
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 |
Instance Method Details
#call ⇒ Object
Executes the command. Broadcast this events:
-
:ok when everything is valid
-
:invalid when the form wasn’t valid and couldn’t 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 |