Class: Projects::GitlabProjectsImportService

Inherits:
Object
  • Object
show all
Includes:
Gitlab::TemplateHelper, Gitlab::Utils::StrongMemoize
Defined in:
app/services/projects/gitlab_projects_import_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::TemplateHelper

#prepare_template_environment, #tmp_filename

Constructor Details

#initialize(user, import_params, override_params = nil) ⇒ GitlabProjectsImportService

Returns a new instance of GitlabProjectsImportService.



13
14
15
16
17
# File 'app/services/projects/gitlab_projects_import_service.rb', line 13

def initialize(user, import_params, override_params = nil)
  @current_user = user
  @params = import_params.dup
  @override_params = override_params
end

Instance Attribute Details

#current_userObject (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

#paramsObject (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

#executeObject



19
20
21
22
23
24
25
# File 'app/services/projects/gitlab_projects_import_service.rb', line 19

def execute
  prepare_template_environment(template_file)

  prepare_import_params

  ::Projects::CreateService.new(current_user, params).execute
end