Class: Artisan::Projects::ArchiveInteractor
- Inherits:
-
Object
- Object
- Artisan::Projects::ArchiveInteractor
- Defined in:
- lib/artisan/projects/archive_interactor.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #archive ⇒ Object
-
#initialize(project_id, user) ⇒ ArchiveInteractor
constructor
A new instance of ArchiveInteractor.
- #unarchive ⇒ Object
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
#project ⇒ Object (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
#archive ⇒ Object
12 13 14 15 |
# File 'lib/artisan/projects/archive_interactor.rb', line 12 def archive @project = find_project @project.update_attribute(:archived, true) end |
#unarchive ⇒ Object
17 18 19 20 |
# File 'lib/artisan/projects/archive_interactor.rb', line 17 def unarchive @project = find_project @project.update_attribute(:archived, false) end |