Class: Decidim::Votings::Admin::DestroyBallotStyle
- Inherits:
-
Rectify::Command
- Object
- Rectify::Command
- Decidim::Votings::Admin::DestroyBallotStyle
- Defined in:
- 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) ⇒ DestroyBallotStyle
constructor
A new instance of DestroyBallotStyle.
Constructor Details
#initialize(ballot_style) ⇒ DestroyBallotStyle
Returns a new instance of DestroyBallotStyle.
8 9 10 |
# File 'app/commands/decidim/votings/admin/destroy_ballot_style.rb', line 8 def initialize(ballot_style) @ballot_style = ballot_style 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.
17 18 19 20 21 |
# File 'app/commands/decidim/votings/admin/destroy_ballot_style.rb', line 17 def call destroy_ballot_style! broadcast(:ok) end |