An open API service indexing awesome lists of open source software.

https://github.com/adel-gu/own-enumerable


https://github.com/adel-gu/own-enumerable

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

logo

Microverse README Template

# 📗 Table of Contents

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

# 📖 Own Enumerable

The main purpose of this repo is to practice using modules inside classes, so for this project, I created a class called `Mylist` that will hold a collection of items ("array of numbers"), and a `MyEnumerable` module that will contain the enumerable methods to manipulate the collections of `MyClass` list, thus methods are:

- `all?`
- `any?`
- `filter`

## 🛠 Built With

### Tech Stack
- Build using [Ruby](https://www.ruby-lang.org/en/)

### Key Features

- **all?** [all? method explained](https://ruby-doc.org/core-3.0.0/Enumerable.html#method-i-all-3F)
- **any?** [any? method explained](https://ruby-doc.org/core-3.0.0/Enumerable.html#method-i-any-3F)
- **filter** [filter method explained](https://ruby-doc.org/core-3.0.0/Enumerable.html#method-i-filter)

(back to top)

## 💻 Getting Started

To get a local copy up and running, follow these steps.

### Prerequisites

In order to run this project you need:

- Ruby should be installed localy in your system.
- You need a code editore such as `VsCode`.

### Setup

Clone this repository to your desired folder:

```sh
cd my-folder
git clone [email protected]:adel-gu/own-enumerable.git
```

### Install

Install this project with:

```sh
cd my-project
bundel install
```

### Usage

To try the project, you can add any line of code to test out the Enumerable methods created, ensure to add your line of code at the bottom in `list.rb` file.

Example code:

```rb
# create your list
list = MyList.new(1, 2, 3, 4)

# test out all?
p list.all? {|e| e < 5}

# test out any?
p list.any? {|e| e == 2}

# test out filter
p list.filter {|e| e.even?}
```

To be able to run the program file kindly in your terminal execute the command line bellow

```sh
ruby list.rb
```

## 👥 Authors

👤 **Adel Guitoun**

- GitHub: [@adel-gu](https://github.com/adel-gu)
- Twitter: [@GuitounAdel](https://twitter.com/GuitounAdel)
- LinkedIn: [adelguitoun](https://linkedin.com/in/adelguitoun)

(back to top)

## 🔭 Future Features
- [ ] **max**
- [ ] **min**
- [ ] **sort**

(back to top)

## 🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the [issues page](../../issues/).

(back to top)

## ⭐️ Show your support

If you like this project, kindly give it a start ❤

(back to top)

## 📝 License

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

(back to top)