forked from stringer-rss/stringer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple implementation of star/unstar feature via fever api
- Loading branch information
1 parent
331fe28
commit 8b25fde
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require_relative "../../repositories/story_repository" | ||
|
||
class MarkAsStarred | ||
def initialize(story_id, repository = StoryRepository) | ||
@story_id = story_id | ||
@repo = repository | ||
end | ||
|
||
def mark_as_starred | ||
@repo.fetch(@story_id).update_attributes(is_starred: true) | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require_relative "../../repositories/story_repository" | ||
|
||
class MarkAsUnstarred | ||
def initialize(story_id, repository = StoryRepository) | ||
@story_id = story_id | ||
@repo = repository | ||
end | ||
|
||
def mark_as_unstarred | ||
@repo.fetch(@story_id).update_attributes(is_starred: false) | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters