khanh-devos / ruby-cap-catalog

MIT License
0 stars 0 forks source link

Implement Game and Author Classes with Associations #8

Closed kit0-0 closed 1 year ago

kit0-0 commented 1 year ago

Description: This pull request introduces the following changes:

  1. Creates a Game class in a separate .rb file with properties defined and set up in the constructor method.
  2. Creates an Author class in a separate .rb file with properties defined and set up in the constructor method and establishes an association with the Item class.
  3. Implements the add_item method in the Author class, allowing it to add an instance of the Item class to the collection of items and set itself as a property of the item.
  4. Implements the can_be_archived? method in the Game class, which overrides the parent class's method to return true if the parent's method returns true and if the last_played_at is older than 2 years; otherwise, it returns false.
  5. Adds unit tests.
  6. Provides options to list games, list all authors, and add a game, with data preservation using .json files.