https://github.com/mahammad-mostafa/school-library
This is the fifth project in the fourth module of the Microverse program. It is about a school library application implemented with Object Oriented Programming concepts using Ruby.
https://github.com/mahammad-mostafa/school-library
aggregates associations composition decorator-design-pattern decorator-pattern gitflow gitflow-workflow inheritance microverse microverse-projects microverse-ruby microverse-students oop oop-in-ruby polymorphism rspec rubocop ruby solid-principles unit-testing
Last synced: about 1 month ago
JSON representation
This is the fifth project in the fourth module of the Microverse program. It is about a school library application implemented with Object Oriented Programming concepts using Ruby.
- Host: GitHub
- URL: https://github.com/mahammad-mostafa/school-library
- Owner: mahammad-mostafa
- License: mit
- Created: 2023-10-18T14:08:41.000Z (over 1 year ago)
- Default Branch: development
- Last Pushed: 2023-10-28T19:51:30.000Z (over 1 year ago)
- Last Synced: 2025-02-13T05:17:29.278Z (3 months ago)
- Topics: aggregates, associations, composition, decorator-design-pattern, decorator-pattern, gitflow, gitflow-workflow, inheritance, microverse, microverse-projects, microverse-ruby, microverse-students, oop, oop-in-ruby, polymorphism, rspec, rubocop, ruby, solid-principles, unit-testing
- Language: Ruby
- Homepage:
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 🏷️ School Library
This is the fifth project of the fourth module in the **Microverse** program.
Check the below contents for further details about this project.# 📗 Contents
- [Description](#description)
- [Instructions](#instructions)
- [Authors](#authors)
- [Future](#future)
- [Contributions](#contributions)
- [Support](#support)
- [Acknowledgements](#acknowledgements)
- [License](#license)# 📖 Description
The project follows Object Oriented Programming using `Ruby`.
This repository includes ten class files (`Person` / `Student` / `Teacher` / `Classroom` / `Book` / `Rental` / `Nameable` / `Decorator` / `Capitalize` / `Trimmer`).
Special class `App` for handling all app operations and a file `main.rb` as entry point for it.
Module `Storage` used for handling JSON files read & write.
Decorator design pattern is implemented for adding several operations on `name` variable in `Person` class.
Several associations exist bewteen some classes.
All data is preserved inside three files (`books.json` / `people.json` / `rentals.json`).
Unit testing is carried on ten classes (`Person` / `Student` / `Teacher` / `Classroom` / `Book` / `Rental` / `Nameable` / `Decorator` / `Capitalize` / `Trimmer`).
Every method in the above classes has an example test case inside `specs` directory.📌 **Tech Stack:**
- Code built with `Ruby`
- Unit tests uses `RSpec`
- Linting is done with `Rubocop`📌 **Key Features:**
- Class `Nameable` is a parent class for both `Person` & `Decorator`
- Class `Person` is a parent class for both `Student` & `Teacher`
- Class `Decorator` is a parent class for both `Capitalize` & `Trimmer`
- Class `Person` includes a constructor & four methods
- Constructor in `Person` class includes three arguments (`age` / `name` / `parent_permission`)
- First method in `Person` class is a public method called `add_rental`
- Second method in `Person` class is a public method called `can_use_services`
- Third method in `Person` class is an unherited method called `correct_name`
- Fourth method in `Person` class is a private method called `of_age`
- Class `Student` includes a constructor & four methods
- Constructor in `Student` class includes three arguments (`classroom` / `age` / `name` / `parent_permission`)
- First method in `Student` class is a public method called `play_hooky`
- Second method in `Student` class is a static method called `input_arguments`
- Third method in `Student` class is a public method called `generate_string`
- Fourth method in `Student` class is a static method called `parse_string`
- Constructor in `Teacher` class includes three arguments (`specialization` / `age` / `name` / `parent_permission`)
- First method in `Teacher` class is a public method that overrides `can_use_services` from parent class
- Second method in `Teacher` class is a static method called `input_arguments`
- Third method in `Teacher` class is a public method called `generate_string`
- Fourth method in `Teacher` class is a static method called `parse_string`
- Class `Nameable` includes one method `correct_name` that raises an exception
- Class `Decorator` includes only constructor that passes a `Nameable` object
- Class `Capitalize` includes one inherited method `correct_name` & overrides it
- Class `Trimmer` includes one inherited method `correct_name` & overrides it
- Class `Classroom` includes a constructor & three methods
- Constructor in `Classroom` includes one argument `label`
- First method in `Classroom` class is public method `add_student`
- Second method in `Classroom` class is a public method called `generate_string`
- Third method in `Classroom` class is a static method called `parse_string`
- Class `Book` includes a constructor & three methods
- Constructor in `Book` includes two arguments (`title` / `author`)
- First method in `Book` class is public method `add_rental`
- Second method in `Book` class is a public method called `generate_string`
- Third method in `Book` class is a static method called `parse_string`
- Class `Rental` includes only one constructor & three methods
- First method in `Rental` class is a static method called `input_arguments`
- Second method in `Rental` class is a public method called `generate_string`
- Third method in `Rental` class is a static method called `parse_string`
- Constructor in `Book` includes three arguments (`date` / `book` / `person`)
- First method in `Book` class is a static method called `input_arguments`
- Second method in `Book` class is a public method called `generate_string`
- Third method in `Book` class is a static method called `parse_string`
- Class `App` includes a constructor & twelve methods
- Constructor in `App` initializes several empty arrays
- Entry point in `main.rb` file with infinite loop
- Module `Storage` includes two methods (`read_file` / `write_file`)# 🛠️ Instructions
You can easily download or fork this repository and work on it immadiately!
📌 **Prerequisites:**
- You need `Ruby` language installed📌 **Installation:**
- To install all gem dependencies run
```
bundle install
```📌 **Development:**
- Run `main.rb` file with
```
ruby main.rb
```📌 **Tests:**
- To run unit tests navigate to `specs` directory and run:
```
rspec . -f d
```# 👥 Authors
📌 **Mahammad:**
- [GitHub](https://github.com/mahammad-mostafa)
- [Twitter](https://twitter.com/mahammad_mostfa)
- [LinkedIn](https://linkedin.com/in/mahammad-mostafa)📌 **Alexander:**
- [GitHub](https://github.com/alexansaa)
- [LinkedIn](https://www.linkedin.com/in/alexander-saavedra-2803b1b6)📌 **Austin:**
- [GitHub](https://github.com/stino-x)# 🔭 Future
Some additional features I may implement in the project:
- [ ] Implement better visual interface# 🤝🏻 Contributions
Wish to contribute to this project?
Contributions, issues, and feature requests are more than welcome!
Feel free to check the [issues](../../issues) page too.# ⭐️ Support
Like this project? Show your support by starring!
# 🙏🏻 Acknowledgements
I thank everyone at **Microverse** for guiding me through this project.
# 📝 License
This project is [MIT](LICENSE.md) licensed.