Class: Suggestions::ApplyService
- Inherits:
-
BaseService
- Object
- BaseService
- Suggestions::ApplyService
- Defined in:
- app/services/suggestions/apply_service.rb
Instance Attribute Summary
Attributes inherited from BaseService
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(current_user, *suggestions, message: nil) ⇒ ApplyService
constructor
A new instance of ApplyService.
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(current_user, *suggestions, message: nil) ⇒ ApplyService
Returns a new instance of ApplyService.
5 6 7 8 9 |
# File 'app/services/suggestions/apply_service.rb', line 5 def initialize(current_user, *suggestions, message: nil) @current_user = current_user @message = @suggestion_set = Gitlab::Suggestions::SuggestionSet.new(suggestions) end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/services/suggestions/apply_service.rb', line 11 def execute if suggestion_set.valid? result else error(suggestion_set.) end end |