Skip to content

Commit

Permalink
resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
CobbyElsonfx committed Nov 10, 2023
2 parents 7d1f2c0 + dff92ec commit d6c6027
Show file tree
Hide file tree
Showing 11 changed files with 432 additions and 7 deletions.
22 changes: 21 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
LICENSE
MIT License

Copyright (c) 2023 Fatema Nazari

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (Catalog of My Things), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
148 changes: 147 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,147 @@
README FILE
<a name="readme-top"></a>

# 📗 Table of Contents

- [📖 About the Project](#about-project)
- [🛠 Built With](#built-with)
- [Tech Stack](#tech-stack)
- [Key Features](#key-features)
- [💻 Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Setup](#setup)
- [Usage](#usage)
- [👥 Author](#author)
- [🔭 Future Features](#future-features)
- [🤝 Contributing](#contributing)
- [⭐️ Show your support](#support)
- [🙏 Acknowledgments](#acknowledgments)
- [📝 License](#license)

<!-- PROJECT DESCRIPTION -->

# 📖 [Catalog of My Things] <a name="about-project"></a>

> This project is a console app that will help you to keep a record of different types of things you own: books, music albums, movies, and games. The data will be stored in JSON files but you will also prepare a database with tables structure analogical to your program's class structure.
## 🛠 Built With <a name="built-with"></a>

### Tech Stack <a name="tech-stack"></a>

> Ruby
<details>
<summary>Ruby</summary>
<ul>
<li>Ruby Programming Language</li>
</ul>
</details>

<!-- Features -->

### Key Features <a name="key-features"></a>

> Demonstrating Ruby programming concepts
- **[Ruby Basics]**
- **[Object-Oriented Programming in Ruby]**
- **[Ruby File Organization]**

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- GETTING STARTED -->

## 💻 Getting Started <a name="getting-started"></a>

> Learn about Ruby programming
To get started with this Ruby project, follow these steps.

### Prerequisites

In order to run this project, you need:

- Ruby installed on your computer

### Setup

Clone this repository to your desired folder:

```bash
git clone git@github.com:78fatemanazari/ruby-capstone.git
```

### Usage

To run the project, execute the following command:

```bash
ruby main.rb
```

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- AUTHOR -->

## 👥 Author <a name="author"></a>

👤 **Md.Rafiduzzaman**
- GitHub: [@Rafiduzzaman](https://github.com/Rafiduzzaman)
- Twitter: [@rdzaman](https://twitter.com/rdzaman187468)
- LinkedIn: [@md-rafiduzzaman-nahin](https://www.linkedin.com/in/md-rafiduzzaman-nahin-7431ab1b4/)

👤 **Fatema Nazari**
- GitHub: [@78fatemanazari](https://github.com/78fatemanazari)
- Twitter: [@fati_nazari78](https://twitter.com/fati_nazari78?s=31)
- LinkedIn: [78fatemanazari](https://www.linkedin.com/in/78fatemanazari)

👤 **Mr. Francis Andoh**
- GitHub: [@CobbyElsonfx](https://github.com/CobbyElsonfx)
- LinkedIn: [@FrancisAndoh](https://www.linkedin.com/in/francis-andoh-133aa7245/)

<p align="right">(<a href="#readme-top">back to top</a>)</p>


<!-- FUTURE FEATURES -->

## 🔭 Future Features <a name="future-features"></a>

> This project may include the following features in the future
- **[Ruby Web Development with Sinatra]**
- **[Integration of Ruby Gems]**

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- CONTRIBUTING -->

## 🤝 Contributing <a name="contributing"></a>

Contributions, issues, and feature requests are welcome!

Feel free to check the [issues page](https://github.com/Rafiduzzaman/Classroom/issues).

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- SUPPORT -->

## ⭐️ Show your support <a name="support"></a>

> If you find this project helpful, please consider giving it a star.
<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- ACKNOWLEDGEMENTS -->

## 🙏 Acknowledgments <a name="acknowledgments"></a>

> Special thanks to the Ruby community for their valuable resources and support.
<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- LICENSE -->

## 📝 License <a name="license"></a>

This project is [MIT](./LICENSE) licensed.

<p align="right">(<a href="#readme-top">back to top</a>)</p>
39 changes: 39 additions & 0 deletions book.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
require_relative 'item'

class Book < Item
attr_reader :title, :author, :publisher
attr_accessor :cover_state, :label

def initialize(params)
super(params[:id], params[:publish_date])
@title = params[:title]
@author = params[:author]
@cover_state = params[:cover_state]
@publisher = params[:publisher]
@label = nil
end

def can_be_archived?
super || @cover_state == 'bad'
end

def assign_label(label)
@label = label
end

def to_json(*_args)
{
id: id,
publish_date: publish_date,
title: title,
author: author,
cover_state: cover_state,
publisher: publisher
}.to_json
end

def self.from_json(json)
data = JSON.parse(json)
new(data)
end
end
1 change: 0 additions & 1 deletion data_storage.rb

This file was deleted.

2 changes: 1 addition & 1 deletion item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def add_author(author)
@authors << author
end

def add_label(label)
def label=(label)
@labels << label
end

Expand Down
30 changes: 30 additions & 0 deletions label.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
class Label
attr_reader :id, :title, :color
attr_accessor :items

def initialize(id, title, color)
@id = id
@title = title
@color = color
@items = []
end

def add_item(item)
items << item
item.label = self
end

def to_json(*_args)
{
id: id,
title: title,
color: color,
items: items.map(&:id)
}.to_json
end

def self.from_json(json)
data = JSON.parse(json)
new(data['id'], data['title'], data['color'])
end
end
1 change: 0 additions & 1 deletion load_json.rb

This file was deleted.

Loading

0 comments on commit d6c6027

Please sign in to comment.