Class: Decidim::InviteUserAgain

Inherits:
Command
  • Object
show all
Defined in:
app/commands/decidim/invite_user_again.rb

Overview

A command with the business logic to invite an user to an organization.

Instance Method Summary collapse

Methods inherited from Command

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

Constructor Details

#initialize(user, instructions) ⇒ InviteUserAgain

Public: Initializes the command.

user - The user that receives the invitation instructions. instructions - The invitation instructions that is sent to the user.



10
11
12
13
# File 'app/commands/decidim/invite_user_again.rb', line 10

def initialize(user, instructions)
  @user = user
  @instructions = instructions
end

Dynamic Method Handling

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

Instance Method Details

#callObject



15
16
17
18
# File 'app/commands/decidim/invite_user_again.rb', line 15

def call
  user.invite!(user.invited_by, invitation_instructions: instructions)
  broadcast(:ok)
end