Class: Decidim::Notify::Admin::DestroyChapter
- Inherits:
-
Rectify::Command
- Object
- Rectify::Command
- Decidim::Notify::Admin::DestroyChapter
- Defined in:
- app/commands/decidim/notify/admin/destroy_chapter.rb
Instance Attribute Summary collapse
-
#chapter ⇒ Object
readonly
Returns the value of attribute chapter.
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(chapter) ⇒ DestroyChapter
constructor
Public: Initializes the command.
Constructor Details
#initialize(chapter) ⇒ DestroyChapter
Public: Initializes the command.
chapter - the chapter to be update
10 11 12 |
# File 'app/commands/decidim/notify/admin/destroy_chapter.rb', line 10 def initialize(chapter) @chapter = chapter end |
Instance Attribute Details
#chapter ⇒ Object (readonly)
Returns the value of attribute chapter.
26 27 28 |
# File 'app/commands/decidim/notify/admin/destroy_chapter.rb', line 26 def chapter @chapter end |
Instance Method Details
#call ⇒ Object
Executes the command. Broadcasts these events:
-
:ok when everything is valid.
-
:invalid if we couldn’t proceed.
Returns nothing.
20 21 22 23 24 |
# File 'app/commands/decidim/notify/admin/destroy_chapter.rb', line 20 def call chapter.destroy! broadcast(:ok) end |