Class: Packages::CreateDependencyService

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

Overview

rubocop: disable Gitlab/BulkInsert

Instance Attribute Summary collapse

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.


7
8
9
10
# File 'app/services/packages/create_dependency_service.rb', line 7

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

Instance Attribute Details

#dependenciesObject (readonly)

Returns the value of attribute dependencies.


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

def dependencies
  @dependencies
end

#packageObject (readonly)

Returns the value of attribute package.


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

def package
  @package
end

Instance Method Details

#executeObject


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

def execute
  Packages::DependencyLink.dependency_types.each_key do |type|
    create_dependency(type)
  end
end