Class: ProtectedBranches::BaseService

Inherits:
BaseService show all
Defined in:
app/services/protected_branches/base_service.rb

Instance Attribute Summary collapse

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

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

#can?

Constructor Details

#initialize(project_or_group, current_user = nil, params = {}) ⇒ BaseService

current_user - The user that performs the action params - A hash of parameters



9
10
11
12
13
# File 'app/services/protected_branches/base_service.rb', line 9

def initialize(project_or_group, current_user = nil, params = {})
  @project_or_group = project_or_group
  @current_user = current_user
  @params = params
end

Instance Attribute Details

#project_or_groupObject (readonly)

Returns the value of attribute project_or_group.



5
6
7
# File 'app/services/protected_branches/base_service.rb', line 5

def project_or_group
  @project_or_group
end

Instance Method Details

#after_executeObject



15
16
17
# File 'app/services/protected_branches/base_service.rb', line 15

def after_execute(*)
  # overridden in EE::ProtectedBranches module
end

#refresh_cacheObject



19
20
21
22
23
# File 'app/services/protected_branches/base_service.rb', line 19

def refresh_cache
  CacheService.new(@project_or_group, @current_user, @params).refresh
rescue StandardError => e
  Gitlab::ErrorTracking.track_exception(e)
end