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

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

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

Returns a new instance of GitlabProjectsImportService.


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

def initialize(user, import_params, override_params = nil)
  @current_user, @params, @override_params = user, import_params.dup, 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


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

def execute
  prepare_template_environment(template_file)

  prepare_import_params

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