Class: Projects::GitlabProjectsImportService
- Inherits:
-
Object
- Object
- Projects::GitlabProjectsImportService
- Includes:
- Gitlab::TemplateHelper, Gitlab::Utils::StrongMemoize
- Defined in:
- app/services/projects/gitlab_projects_import_service.rb
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(user, import_params, override_params = nil, import_type:) ⇒ GitlabProjectsImportService
constructor
A new instance of GitlabProjectsImportService.
Methods included from Gitlab::TemplateHelper
#prepare_template_environment, #tmp_filename
Constructor Details
#initialize(user, import_params, override_params = nil, import_type:) ⇒ GitlabProjectsImportService
Returns a new instance of GitlabProjectsImportService.
13 14 15 16 17 18 19 20 |
# File 'app/services/projects/gitlab_projects_import_service.rb', line 13 def initialize(user, import_params, override_params = nil, import_type:) @current_user = user @params = import_params.dup @override_params = override_params @import_type = import_type.to_s raise ArgumentError, 'Invalid import_type provided' unless valid_import_type? end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
11 12 13 |
# File 'app/services/projects/gitlab_projects_import_service.rb', line 11 def current_user @current_user end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
11 12 13 |
# File 'app/services/projects/gitlab_projects_import_service.rb', line 11 def params @params end |
Instance Method Details
#execute ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/services/projects/gitlab_projects_import_service.rb', line 22 def execute prepare_template_environment(template_file, current_user) prepare_import_params ::Projects::CreateService.new(current_user, params).execute end |