Skip to content

Our own implementaion of Ruby’s enumerable methods

Notifications You must be signed in to change notification settings

bini-i/enumerable-methods

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enumerable methods

This project is our own implementaion of Ruby’s enumerable methods

screenshot

How to use this repo?

  • Clone the repo

option 1 (to include in your project)

  • 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

option 2 (to test in REPL)

  • 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

Live Demo

Live Demo Link

Built With

  • Ruby

Authors

👤 Binyam Hailemeskel

👤 Dibyendu Das

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

About

Our own implementaion of Ruby’s enumerable methods

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Ruby 100.0%