In this project, methods like Enumerables were created. They required a block for iterating an array or a hash.
- My_each Require a block and applied in each item of an array
- my_each_with_index Require a block and applied in each item of an array and its index
- my_select Require a block and return items selected by the criteria given by the block_given
- my_all? Check each item of an Enumerable and return true if all items are true, else false, depending on the criteria given by a block
- my_any? Check each item of an Enumerable and return True, if any item is True, else false, depending on the criteria given by a block
- my_none? Check each item of an Enumerable and return True, if none item is true, else false, depending on the criteria given by a block.
- my_count Return total of items with the criteria given by a block or argument. If any block or argument is added, it will return the number of items of an Enumerable.
- my_map, my_map_proc, my_map_proc_yield Returns a new array following the criteria of a block_given
- my_inject Apply a process to two items, keep the result and applied to the next one.
- mupliply_els Multiply the items of a given Enumerable between them
- Ruby
- Atom
To get a local copy up and running, clone this repo and test it in IRB, or add like a module in your projects.
- OS: MacOS, Ubuntu or a Virtual Machine
- Code editor.
- Have Ruby installed.
π€ Juan Paulo Perez Tejada
- Github: @Maclenn77
- Twitter: @srjuanpapas
- Linkedin: Juan Paulo Perez Tejada
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a βοΈ if you like this project!
- Hat tip to anyone whose code was used
- Inspiration
- etc
This project is MIT licensed.
