debian-mirror-gitlab/app/services/base_service.rb

23 lines
755 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2020-05-24 23:13:21 +05:30
# 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-09-02 18:07:02 +05:30
class BaseService
2020-05-24 23:13:21 +05:30
include BaseServiceUtility
2015-04-26 12:48:37 +05:30
2014-09-02 18:07:02 +05:30
attr_accessor :project, :current_user, :params
2018-11-08 19:23:39 +05:30
def initialize(project, user = nil, params = {})
2014-09-02 18:07:02 +05:30
@project, @current_user, @params = project, user, params.dup
end
2017-08-17 22:00:37 +05:30
delegate :repository, to: :project
2014-09-02 18:07:02 +05:30
end