Class: Packages::Nuget::CreateDependencyService

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/packages/nuget/create_dependency_service.rb

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

#initialize(package, dependencies = []) ⇒ CreateDependencyService

Returns a new instance of CreateDependencyService.


5
6
7
8
# File 'app/services/packages/nuget/create_dependency_service.rb', line 5

def initialize(package, dependencies = [])
  @package = package
  @dependencies = dependencies
end

Instance Method Details

#executeObject


10
11
12
13
14
15
16
17
# File 'app/services/packages/nuget/create_dependency_service.rb', line 10

def execute
  return if @dependencies.empty?

  @package.transaction do
    create_dependency_links
    
  end
end