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.
|
|
|
|
#
|
|
|
|
# TODO: New services should consider inheriting from
|
|
|
|
# BaseContainerService, or create new base class:
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/issues/216672
|
2014-01-16 12:03:42 -05:00
|
|
|
class BaseService
|
2020-05-07 14:09:28 -04:00
|
|
|
include BaseServiceUtility
|
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 = {})
|
2012-07-20 01:39:34 -04:00
|
|
|
@project, @current_user, @params = project, user, params.dup
|
|
|
|
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
|