Class: Decidim::ResendConfirmationInstructions

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

Instance Method Summary collapse

Methods inherited from Command

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

Constructor Details

#initialize(user) ⇒ ResendConfirmationInstructions

Returns a new instance of ResendConfirmationInstructions.



5
6
7
8
# File 'app/commands/decidim/resend_confirmation_instructions.rb', line 5

def initialize(user)
  @user = user
  @unconfirmed_email = user.unconfirmed_email
end

Dynamic Method Handling

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

Instance Method Details

#callObject



10
11
12
13
14
15
16
# File 'app/commands/decidim/resend_confirmation_instructions.rb', line 10

def call
  return broadcast(:invalid) unless @unconfirmed_email

  ResendConfirmationInstructionsJob.perform_later(@user)

  broadcast(:ok)
end