Giter Club home page Giter Club logo

catalog-of-stuff's Introduction

Catalog of Stuff

Ruby Capstone Project meant to wrap the concepts of Ruby language and SQL Databases, creating a OOP project based on an UML diagram. In this project, we created a console app that will help us to keep a record of different types of things we won: books, music albums, and games. Everything will be based on the UML class diagram presented below. The data will be stored in JSON files but we also prepared a database with tables structure analogical to our program's class structure.

UML class diagram

Preview

console app

Requirements

  • You need to have Ruby and bundle installed in order to run this files

Built With

  • Languages: Ruby
  • Frameworks: N/A
  • Technologies used: Visual Studio Code

Getting Started

Clone this repository

$ git clone [email protected]:JohnFTitor/catalog-of-stuff.git
$ cd catalog-of-stuff

$ bundle install

To run the code

$ ruby src/main.rb

Alternatively, you can run this command on your terminal to make main.rb executable

$ chmod 755 src/main.rb

And run it like this

$ ./main.rb

How to run tests (On root directory)

$ rspec src/spec

Authors

πŸ‘€ Sahar Abdel Samad

πŸ‘€ Zeeshan Haider

πŸ‘€ AndrΓ©s Felipe Arroyave Naranjo

🀝 Contributing

Contributions, issues, and feature requests are welcome!

Show your support

Give a ⭐️ if you like this project!

catalog-of-stuff's People

Contributors

johnftitor avatar zhadier avatar sahar-abdelsamad avatar

Stargazers

 avatar Mohamed EL-Raghy avatar Kyrillos Hany avatar  avatar Reem janina  avatar Robert Loterh avatar Mar Bautista avatar Leonardo Albornoz avatar

Watchers

 avatar

catalog-of-stuff's Issues

[2pt] Create Label class associated to the item class

Create a Book class in a separate .rb file

  • All Label class properties visible in the diagram should be defined and set up in the constructor method.
  • 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)
  • Add unit tests for all implemented methods.

[2pt] Create App Methods for Game

Create App Methods for Game

  • The following options should be available:
    • List of games
    • List all authors (e.g. 'Stephen King')
    • Add a game

[2pt] Create Book Class

Create a Book class in a separate .rb file

  • All Book class properties visible in the diagram should be defined and set up in the constructor method.
  • Implement Methods
    • 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 "bad". Otherwise, it should return false
  • Add unit tests for all implemented methods.

[1pt] Create a schema.sql for Music

Create a schema.sql for Music

  • Create a schema.sql file with tables that will be analogical to the structure of the classes that you created:
    • music_albums table (add all properties and associations from the parent Item class as table columns)
    • genres table

[2pt] Create a Game Class

Create a Game class in a separate .rb file.

  • All Game class properties visible in the diagram should be defined and set up in the constructor method.
  • Implement methods:
    • can_be_archived?() in the Game class
      • should override the method from the parent class
      • should return true if parent's method returns true AND if last_played_at is older than 2 years
      • otherwise, it should return false
  • Add unit tests for all implemented methods.

[2pt] Define App methods for Books

Define App methods for books

  • The following options should be available:
    • List all books
    • List all labels (e.g. 'Gift', 'New')
    • Add a book

[2pt] Create Music Class

Create MusicAlbum class in a separate .rb file.

  • All MusicAlbum class properties visible in the diagram should be defined and set up in the constructor method.
  • Implement methods:
  • can_be_archived?() in the MusicAlbum class
    • should override the method from the parent class
    • should return true if parent's method returns true AND if on_spotify equals true. Otherwise, it should return false
  • Add unit tests for all implemented methods.

[2pt] Create an Author Class

Create an Author class with an association to the Item class (in a separate .rb file).

  • All Author class properties visible in the diagram should be defined and set up in the constructor method.
  • 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)
  • Add unit tests for all implemented methods.

[2pt] Create App Methods for Music

Create App Methods for Music

  • The following options should be available:
    • List all music albums
    • List all genres (e.g 'Comedy', 'Thriller')
    • Add a music album

[2pt] Create a Genre Class

Create Genre class with an association to the Item class (in a separate .rb file).

  • All Genre class properties visible in the diagram should be defined and set up in the constructor method.
  • 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)
  • Add unit tests for all implemented methods.

[1pt] Create a schema.sql for Game

Create a schema.sql for Game

  • Create a schema.sql file with tables that will be analogical to the structure of the classes that you created:
    • games table (add all properties and associations from the parent Item class as table columns)
    • authors table

[2.5pt] Create Item Class - Group

  • Create 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.

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

[1pt] Define Schema.sql tables for Books

Define Schema.sql tables for Books

  • Create a schema.sql file with tables that will be analogical to the structure of the classes that you created:
    • books table (add all properties and associations from the parent Item class as table columns)
    • labels table

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.