View Code? Open in Web Editor
NEW
Catalog of my things is console app that will help you to keep a record of different types of things you own: books, music albums, and games. Everything will be based on the UML class diagram presented below. The data will be stored in JSON files. Created using Ruby!
License: MIT License
catalog-of-my-things's People
Watchers
catalog-of-my-things's Issues
Create a schema.sql
file with tables that will be analogical to the structure of the classes that you created:
Enhance the look and feel of the Ruby CLI App.
You can use tools like Colorize. ๐จ
Implement methods:
add_item
method in the Genre
class
Should take an instance of the Item
class as an input
Should add the input item to the collection of items
Should add self as a property of the item object (by using the correct setter from the item object)
can_be_archived?()
in the MusicAlbum
class
Should override the method from the parent class
Should return true if the parent's method returns true AND if on_spotify equals true
Otherwise, it should return false
-Create a schema.sql
file with tables that will be analogical to the structure of the classes that you created:
Implement methods:
add_item
method in the Label
class
Should take an instance of the Item class as an input
Should add the input item to the collection of items
Should add self as a property of the item object (by using the correct setter from the item object)
can_be_archived?()
in the Book
class
Should override the method from the parent class
Should return true if the parent's method returns true OR if cover_state
equals to "bad"
Otherwise, it should return false
Create a main.rb
file that will serve as your console app entry-point.
Implement startup actions:
The following options should be available:
Complete the schema.sql
file with tables that will be analogical to the structure of the classes that you created.
Also add the pertinent code to create the main database that will contain all tables created in previus tasks.
The following options should be available:
-The following options should be available:
Implement methods:
can_be_archived?() in the Item class
should return true if published_date is older than 10 years
Otherwise, it should return false
move_to_archive() in the Item class
Should reuse can_be_archived?() method
Should change the archived property to true if the result of the can_be_archived?() method is true
Should do nothing if the result of the can_be_archived?() method is false
Create a schema.sql file with tables that will be analogical to the structure of the classes that you created:
Implement methods:
add_item
method in the Author
class
Should take an instance of the Item
class as an input
Should add the input item to the collection of items
Should add self as a property of the item object (by using the correct setter from the item object)
can_be_archived
?() in the Game
class
Should override the method from the parent
class
Should return true if the parent's method returns true AND if last_played_at
is older than 2 years
Otherwise, it should return false
Create an Item
class in a separate .rb file.
All Item
class properties visible in the diagram should be defined and set up in the constructor method.
Exception: Properties for the 1-to-many relationships should NOT be set in the constructor method. Instead, they should have a custom setter method created.