Class: Artisan::Projects::ArchiveInteractor

Inherits:
Object
  • Object
show all
Defined in:
lib/artisan/projects/archive_interactor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_id, user) ⇒ ArchiveInteractor

Returns a new instance of ArchiveInteractor.



7
8
9
10
# File 'lib/artisan/projects/archive_interactor.rb', line 7

def initialize(project_id, user)
  @project_id = project_id
  @user = user
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



6
7
8
# File 'lib/artisan/projects/archive_interactor.rb', line 6

def project
  @project
end

Instance Method Details

#archiveObject



12
13
14
15
# File 'lib/artisan/projects/archive_interactor.rb', line 12

def archive
  @project = find_project
  @project.update_attribute(:archived, true)
end

#unarchiveObject



17
18
19
20
# File 'lib/artisan/projects/archive_interactor.rb', line 17

def unarchive
  @project = find_project
  @project.update_attribute(:archived, false)
end