Class: SavedReplies::DestroyService
- Inherits:
-
BaseService
- Object
- BaseService
- SavedReplies::DestroyService
- Defined in:
- app/services/saved_replies/destroy_service.rb
Constant Summary
Constants inherited from BaseService
BaseService::UnauthorizedError
Instance Attribute Summary
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(saved_reply:) ⇒ DestroyService
constructor
A new instance of DestroyService.
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
#initialize(saved_reply:) ⇒ DestroyService
Returns a new instance of DestroyService.
5 6 7 |
# File 'app/services/saved_replies/destroy_service.rb', line 5 def initialize(saved_reply:) @saved_reply = saved_reply end |
Instance Method Details
#execute ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/services/saved_replies/destroy_service.rb', line 9 def execute if saved_reply.destroy success(saved_reply: saved_reply) else error(saved_reply.errors.) end end |