Class: Decidim::Initiatives::RevokeMembershipRequest

Inherits:
Command
  • Object
show all
Defined in:
decidim-initiatives/app/commands/decidim/initiatives/revoke_membership_request.rb

Overview

A command with all the business logic that creates a new initiative.

Instance Method Summary collapse

Methods inherited from Command

call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events

Constructor Details

#initialize(membership_request) ⇒ RevokeMembershipRequest

Public: Initializes the command.

membership_request - A pending committee member



10
11
12
# File 'decidim-initiatives/app/commands/decidim/initiatives/revoke_membership_request.rb', line 10

def initialize(membership_request)
  @membership_request = membership_request
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Decidim::Command

Instance Method Details

#callObject

Executes the command. Broadcasts these events:

  • :ok when everything is valid.

Returns nothing.



19
20
21
22
23
24
# File 'decidim-initiatives/app/commands/decidim/initiatives/revoke_membership_request.rb', line 19

def call
  @membership_request.rejected!
  notify_applicant

  broadcast(:ok, @membership_request)
end