Class: Users::SavedReplies::DestroyService
- Inherits:
-
Object
- Object
- Users::SavedReplies::DestroyService
- Defined in:
- app/services/users/saved_replies/destroy_service.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(saved_reply:) ⇒ DestroyService
constructor
A new instance of DestroyService.
Constructor Details
#initialize(saved_reply:) ⇒ DestroyService
Returns a new instance of DestroyService.
6 7 8 |
# File 'app/services/users/saved_replies/destroy_service.rb', line 6 def initialize(saved_reply:) @saved_reply = saved_reply end |
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/services/users/saved_replies/destroy_service.rb', line 10 def execute if saved_reply.destroy ServiceResponse.success(payload: { saved_reply: saved_reply }) else ServiceResponse.error(message: saved_reply.errors.) end end |