Class: Todos::Destroy::ProjectPrivateService

Inherits:
BaseService
  • Object
show all
Extended by:
Gitlab::Utils::Override
Defined in:
app/services/todos/destroy/project_private_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Utils::Override

extended, extensions, included, method_added, override, prepended, queue_verification, verify!

Constructor Details

#initialize(project_id) ⇒ ProjectPrivateService

Returns a new instance of ProjectPrivateService.



10
11
12
# File 'app/services/todos/destroy/project_private_service.rb', line 10

def initialize(project_id)
  @project = Project.find_by_id(project_id)
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



8
9
10
# File 'app/services/todos/destroy/project_private_service.rb', line 8

def project
  @project
end

Instance Method Details

#executeObject



14
15
16
17
18
# File 'app/services/todos/destroy/project_private_service.rb', line 14

def execute
  return unless todos_to_remove?

  delete_todos
end