Class: SavedReplies::UpdateService
- Inherits:
-
BaseService
- Object
- BaseService
- SavedReplies::UpdateService
- Defined in:
- app/services/saved_replies/update_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:, name:, content:) ⇒ UpdateService
constructor
A new instance of UpdateService.
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:, name:, content:) ⇒ UpdateService
Returns a new instance of UpdateService.
5 6 7 8 9 |
# File 'app/services/saved_replies/update_service.rb', line 5 def initialize(saved_reply:, name:, content:) @saved_reply = saved_reply @name = name @content = content end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/services/saved_replies/update_service.rb', line 11 def execute if saved_reply.update(name: name, content: content) success(saved_reply: saved_reply.reset) else error(saved_reply.errors.) end end |