2018-07-05 10:18:17 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-05-07 18:09:28 +00: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.
|
|
|
|
#
|
|
|
|
# TODO: New services should consider inheriting from
|
|
|
|
# BaseContainerService, or create new base class:
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/issues/216672
|
2014-01-16 17:03:42 +00:00
|
|
|
class BaseService
|
2020-05-07 18:09:28 +00:00
|
|
|
include BaseServiceUtility
|
2015-01-08 17:53:35 +00:00
|
|
|
|
2012-07-20 05:39:34 +00:00
|
|
|
attr_accessor :project, :current_user, :params
|
|
|
|
|
2018-06-06 16:42:18 +00:00
|
|
|
def initialize(project, user = nil, params = {})
|
2012-07-20 05:39:34 +00:00
|
|
|
@project, @current_user, @params = project, user, params.dup
|
|
|
|
end
|
2012-07-28 00:35:24 +00:00
|
|
|
|
2017-02-22 17:51:46 +00:00
|
|
|
delegate :repository, to: :project
|
2012-07-20 05:39:34 +00:00
|
|
|
end
|