Skip to content

kitpao/my_enumerable_methods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues LinkedIn


Enumerable methods

Project developed with Ruby. The objective is to rebuild commonly used iterators methods.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

About The Project

(Click on the image to play with the code! See instructions in Usage) Product Name Screen Shot

In this project I rebuild the following iterator methods used in the enumerator module:

  • #each -> #my_each
  • #each_with_index -> #my_each_with_index
  • #select -> #my_select
  • #all? -> #my_all?
  • #any? -> #my_any?
  • #none? -> #my_none?
  • #count -> #my_count
  • #map -> #my_map
  • #inject -> #my_inject
  • Test #my_inject by creating a method called #multiply_els which multiplies all the elements of the array together by using #my_inject, e.g. multiply_els([2,4,5]) #=> 40
  • Modify #my_map method to take a proc instead.
  • Modify #my_map method to take either a proc or a block. If both are given, preference to the proc.

Built With

The project was developed using the following technologies:

Usage

Click on the image at the top or in the following link,

In the left panel, select "my_methods.rb"

You can try any method in the About the Project section. A fast way to do this is by typing at the end of the document (line 131) in the following format: puts argument.this_method {provide_block_if required}

  • for example puts [10, 19, 18].none? { |num| num>4}

Click on the console and type ruby my_methods.rb and hit enter

You will get the result at the end of the console

Test

For the test, click on the image at the top or in the following link,

  • Click on the console and type gem install rspec then press enter to begin the instalation process
  • Once the process is done, type rspec and press enter to see the 67 test for this game
  • You can see the test files by clicking on the left panel spec/my_methods_spec.rb

Roadmap

See the open issues for a list of proposed features (and known issues).

Contact

Project Link: https://github.com/kitpao/my_enumerable_methods

Kitzia Paola Vidal Marroquin - Github user: kitpao

kitpao91@gmail.com   | Portfolio   | LinkedIn   | Twitter

Acknowledgements

About

Ruby code recreating the ennumerable methods with my own logic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages