Class: AlertManagement::HttpIntegrations::DestroyService
- Inherits:
-
Object
- Object
- AlertManagement::HttpIntegrations::DestroyService
- Defined in:
- app/services/alert_management/http_integrations/destroy_service.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(integration, current_user) ⇒ DestroyService
constructor
A new instance of DestroyService.
Constructor Details
#initialize(integration, current_user) ⇒ DestroyService
Returns a new instance of DestroyService.
8 9 10 11 |
# File 'app/services/alert_management/http_integrations/destroy_service.rb', line 8 def initialize(integration, current_user) @integration = integration @current_user = current_user end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'app/services/alert_management/http_integrations/destroy_service.rb', line 13 def execute return unless allowed? return error_legacy_prometheus unless destroy_allowed? if integration.destroy success else error(integration.errors..to_sentence) end end |