Class: Packages::RemoveTagService

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

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_tag) ⇒ RemoveTagService

Returns a new instance of RemoveTagService.

Raises:

  • (ArgumentError)

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

def initialize(package_tag)
  raise ArgumentError, "Package tag must be set" if package_tag.blank?

  @package_tag = package_tag
end

Instance Attribute Details

#package_tagObject (readonly)

Returns the value of attribute package_tag


4
5
6
# File 'app/services/packages/remove_tag_service.rb', line 4

def package_tag
  @package_tag
end

Instance Method Details

#executeObject


12
13
14
# File 'app/services/packages/remove_tag_service.rb', line 12

def execute
  package_tag.delete
end