This project is our own implementaion of Ruby’s enumerable methods
- Clone the repo
- copy enumerable.rb and helper_methods.rb files in your project
- require enumerable.rb file with in your main program(executable) file using the following comand
require_relative "enumerable.rb"
- now all the methods from the new enumerable.rb file is accessibile from your project
- Open the repo in terminal window
- Install ruby and pry
$ gem install pry (to install pry)
- Open pry
$ pry
- Run the following comand
> load "enumerable.rb"
- Execute any of the methods available on an Array object
- Example
> [2,4,5,1].my_map do |ele|
ele * 2
end
=> [4, 8, 10, 2]
> [2,4,9].my_all?(Integer)
=> true
> [2,4,5,1].my_inject(5) do |acc, ele|
acc *= ele
end
=> 200
- Ruby
👤 Binyam Hailemeskel
- GitHub: @bini-i
- Twitter: @binyamshewa
- LinkedIn: LinkedIn
👤 Dibyendu Das
- GitHub: @DibDas
- Twitter: @DIBYEND78120480
- LinkedIn: Dibyendu Das
Contributions, issues, and feature requests are welcome!
Give a ⭐️ if you like this project!
- Ruby docmentation
- Ruby Guides