Class: Packages::Nuget::SyncMetadatumService

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/services/packages/nuget/sync_metadatum_service.rb

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

#initialize(package, metadata) ⇒ SyncMetadatumService

Returns a new instance of SyncMetadatumService.


8
9
10
11
# File 'app/services/packages/nuget/sync_metadatum_service.rb', line 8

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

Instance Method Details

#executeObject


13
14
15
16
17
18
19
20
21
22
23
# File 'app/services/packages/nuget/sync_metadatum_service.rb', line 13

def execute
  if blank_metadata?
    metadatum.destroy! if metadatum.persisted?
  else
    metadatum.update!(
      license_url: license_url,
      project_url: project_url,
      icon_url: icon_url
    )
  end
end