-
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.
- Loading branch information
1 parent
d366843
commit 5db1d95
Showing
8 changed files
with
302 additions
and
41 deletions.
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
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
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,18 @@ | ||
class Genre | ||
attr_reader :id, :name | ||
attr_accessor :items | ||
|
||
def initialize(id, name) | ||
@id = id | ||
@name = name | ||
@items = [] | ||
end | ||
|
||
def add_item(item) | ||
return if @items.include?(item) | ||
|
||
@items << item | ||
item.genre = self | ||
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,15 @@ | ||
require_relative 'item' | ||
|
||
class MusicAlbum < Item | ||
attr_accessor :on_spotify, :genre | ||
|
||
def initialize(publish_date, on_spotify: false, genre: nil, archived: false) | ||
super(publish_date, archived: archived) | ||
@on_spotify = on_spotify | ||
@genre = genre | ||
end | ||
|
||
def can_be_archived? | ||
super && @on_spotify | ||
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,4 @@ | ||
[{"id":501,"on_spotify":true,"genre":{"id":716,"name":"Test1"},"published_date":"2023-11-01"}, | ||
{"id":619,"on_spotify":true,"genre":{"id":958,"name":"Test2"},"published_date":"2023-11-03"}, | ||
{"id":549,"on_spotify":true,"genre":{"id":826,"name":"Test3"},"published_date":"2023-11-11"}, | ||
{"id":954,"on_spotify":true,"genre":{"id":665,"name":"Test4"},"published_date":"2023-11-02"}] |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
[{"publish_date":"2023-01-02","multiplayer":true,"last_played_at":"2023-10-10"}] | ||
[{"publish_date":"2023-01-02","multiplayer":true,"last_played_at":"2023-10-10"}, | ||
{"publish_date":"2023-11-11","multiplayer":true,"last_played_at":"2023-11-02"}] |
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,2 @@ | ||
[{"id":412,"name":"Test1"},{"id":750,"name":"Test2"}, | ||
{"id":125,"name":"Test3"},{"id":665,"name":"Test4"}] |
Oops, something went wrong.