2018-07-05 06:18:17 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-05-07 14:09:28 -04:00
|
|
|
# This is the original root class for service related classes,
|
|
|
|
# and due to historical reason takes a project as scope.
|
|
|
|
# Later separate base classes for different scopes will be created,
|
|
|
|
# and existing service will use these one by one.
|
|
|
|
# After all are migrated, we can remove this class.
|
|
|
|
#
|
2021-10-28 08:10:22 -04:00
|
|
|
# For new services, please see https://docs.gitlab.com/ee/development/reusing_abstractions.html#service-classes
|
2014-01-16 12:03:42 -05:00
|
|
|
class BaseService
|
2020-05-07 14:09:28 -04:00
|
|
|
include BaseServiceUtility
|
2021-06-21 17:08:33 -04:00
|
|
|
include Gitlab::Experiment::Dsl
|
2015-01-08 12:53:35 -05:00
|
|
|
|
2012-07-20 01:39:34 -04:00
|
|
|
attr_accessor :project, :current_user, :params
|
|
|
|
|
2018-06-06 12:42:18 -04:00
|
|
|
def initialize(project, user = nil, params = {})
|
2021-04-19 17:09:27 -04:00
|
|
|
@project = project
|
|
|
|
@current_user = user
|
|
|
|
@params = params.dup
|
2012-07-20 01:39:34 -04:00
|
|
|
end
|
2012-07-27 20:35:24 -04:00
|
|
|
|
2017-02-22 12:51:46 -05:00
|
|
|
delegate :repository, to: :project
|
2012-07-20 01:39:34 -04:00
|
|
|
end
|