Class: Decidim::System::DestroyOAuthApplication

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

Overview

This command deals with destroying an application from the admin panel.

Instance Method Summary collapse

Methods inherited from Command

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

Constructor Details

#initialize(application, current_user) ⇒ DestroyOAuthApplication

Public: Initializes the command.

application - The OAuthApplication to be destroyed. user - The user that destroys the application.



11
12
13
14
# File 'decidim-system/app/commands/decidim/system/destroy_oauth_application.rb', line 11

def initialize(application, current_user)
  @application = application
  @current_user = current_user
end

Dynamic Method Handling

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

Instance Method Details

#callObject

Public: Executes the command.

Broadcasts :ok if it got destroyed



19
20
21
22
# File 'decidim-system/app/commands/decidim/system/destroy_oauth_application.rb', line 19

def call
  destroy_application
  broadcast(:ok)
end