Skip to content

jicamargo/ruby_enum_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation


my_enumerable


📗 Table of Contents

📖 my_enumerable

The my_enumerable module is designed to mimic a subset of methods found in Ruby's Enumerable module. It includes implementations for all?, any?, and filter methods, which provide similar functionality as their counterparts in Enumerable.

This project serves as a valuable learning opportunity to understand how to use modules in Ruby classes effectively and how to create custom functionality similar to built-in Ruby modules. Developers can use this project as a foundation for further exploration and experimentation with Ruby modules and custom data structures.

🛠 Built With

Tech Stack

Languaje

Key Features

  • Modular Code: The project demonstrates the power of modules in Ruby by implementing the MyEnumerable module, which provides a subset of methods found in Ruby's Enumerable module. The MyList class includes the MyEnumerable module, allowing it to leverage the functionalities provided by the module. This modular approach promotes code reusability, maintainability, and separation of concerns, making it easier to extend or modify the behavior of MyList without directly altering its core implementation.
  • Custom Iteration and Filtering: The MyList class utilizes the each method, which implements custom iteration to yield successive elements from the internal @list. Additionally, the MyEnumerable module implements all?, any?, and filter methods, offering custom functionalities similar to their counterparts in Ruby's Enumerable. These methods allow developers to perform operations like checking if all elements meet a certain condition (all?), verifying if any element satisfies a condition (any?), and filtering elements based on a given criteria (filter). The custom iteration and filtering capabilities provide developers with a deeper understanding of how these operations work under the hood and demonstrate how powerful abstractions can be built using Ruby modules.

(back to top)

🚀 Live Demo

  • Cooming soon

(back to top)

💻 Getting Started

Prerequisites

In order to run this project you need:

  • Step 1: Clone the Repository

Open your terminal or command prompt. Change to the directory where you want to store the project. Clone the my_enumerable repository from GitHub using the following command:

git clone https://github.com/your-username/ruby_enum_example.git
  • Step 2: Install Ruby

Ensure you have Ruby installed on your system. You can check by running:

ruby -v

If Ruby is not installed, download and install it from the official Ruby website (https://rubyinstaller.org/).

Setup

Clone this repository to your desired folder:

Install

Change into the my_enumerable project directory using the command:

cd ruby_enum_example

Usage

To use the my_enumerable, run the script:

ruby ruby_enum_example.rb

(back to top)

👥 Authors

👤 JIC Software (Jorge Camargo)

(back to top)

🔭 Future Features

  • [Sound feedback]: Additional methods from Ruby's Enumerable module in the MyEnumerable module. We will consider adding the map, count, or reduce methods, which are commonly used and offer valuable functionality to manipulate and process collections.

(back to top)

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

(back to top)

⭐️ Show your support

If you like this project, we encourage you to show your support.

Your support can take many forms:

  1. Give a Star: If you find this project useful or interesting, give it a star to show your support. This helps raise awareness of the project and can help it reach a wider audience.

  2. Spread the Word: Share information about this project with your friends, colleagues, and social networks. Help us reach a wider audience who can benefit from this solution.

  3. Provide Feedback: Your feedback is invaluable in shaping the project. Share your thoughts, suggestions, and ideas for improvement. Your input can guide future development efforts.

  4. Sponsorship or Donations: If you or your organization are in a position to support the project financially, consider sponsoring the development efforts or making a donation. Your contribution can help cover hosting costs, support ongoing maintenance, and enable further enhancements.

Thank you for your support.

(back to top)

🙏 Acknowledgments

I would like to thank to Microverse and all the peers and mentors for their support and encouragement.

(back to top)

📝 License

This project is MIT licensed.

(back to top)

About

Program to show the use of enumerable ruby's classes collection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published