https://github.com/adel-gu/own-enumerable
https://github.com/adel-gu/own-enumerable
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/adel-gu/own-enumerable
- Owner: adel-gu
- Created: 2022-12-15T14:33:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-16T08:34:18.000Z (over 2 years ago)
- Last Synced: 2025-01-13T16:47:26.904Z (4 months ago)
- Language: Ruby
- Size: 559 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
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)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`### Tech Stack
- Build using [Ruby](https://www.ruby-lang.org/en/)- **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)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
```👤 **Adel Guitoun**
- GitHub: [@adel-gu](https://github.com/adel-gu)
- Twitter: [@GuitounAdel](https://twitter.com/GuitounAdel)
- LinkedIn: [adelguitoun](https://linkedin.com/in/adelguitoun)## 🔭 Future Features
- [ ] **max**
- [ ] **min**
- [ ] **sort**Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page](../../issues/).
If you like this project, kindly give it a start ❤
This project is [MIT](./MIT.md) licensed.