Class: Decidim::System::RefreshApiUserSecret
- Defined in:
- decidim-system/app/commands/decidim/system/refresh_api_user_secret.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(api_user, current_admin) ⇒ RefreshApiUserSecret
constructor
A new instance of RefreshApiUserSecret.
Methods inherited from Command
call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events
Constructor Details
#initialize(api_user, current_admin) ⇒ RefreshApiUserSecret
Returns a new instance of RefreshApiUserSecret.
6 7 8 9 |
# File 'decidim-system/app/commands/decidim/system/refresh_api_user_secret.rb', line 6 def initialize(api_user, current_admin) @api_user = api_user @current_admin = current_admin end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Decidim::Command
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'decidim-system/app/commands/decidim/system/refresh_api_user_secret.rb', line 11 def call return broadcast(:invalid) if @api_user.blank? return broadcast(:invalid) if @current_admin.blank? transaction do refresh_secret end broadcast(:ok, @api_secret) end |