GithubHelp home page GithubHelp logo

enumerable-methods's Introduction

๐Ÿงฑ Advanced Building Blocks - Ruby Enumerables

Ruby's Enumerable Module

This project is part of a series of projects to be completed by students of Microverse.

This project consists of recreating, from scratch, the Ruby Enumerable Module which is commonly used in day-to-day use. Due to the nature of the 'Enumerable Module' and it's oh-so frequent use - this proves to be an important concept for newcomers to Ruby.

๐Ÿ“ The Project Brief

The assignment can be found in the Odin Project's HTML and CSS course that can be found here.

  1. Create a new Enumerable Module.
  2. Create #my_each without using #each. Use #yield statements and ensure it does the same thing as #each.
  3. Create #my_each_with_index (still not using #each but rather #my_each now).
  4. Create #my_select.
  5. Create #my_all?
  6. Create #my_any?
  7. Create #my_none?
  8. Create #my_count
  9. Create #my_map.
  10. Create #my_inject.
  11. Test our shiny new #my_inject by creating a method called #multiply_els which (suprisingly), multiplies each array element together.
  12. Modify #my_map to take a proc instead of a block (only one at a time though).

๐Ÿงฐ Technologies & Languages Used

  • Ruby 2.3.7p456
  • Rubocop
  • Stickler-CI
  • Git Flow

๐Ÿคฏ The Project

The project can be found at https://github.com/Rhelli/Enumerable-Methods

๐Ÿ’Œ Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

  1. Fork it (https://github.com/Rhelli/Enumerable-Methods/fork)
  2. Create your working branch (git checkout -b [choose-a-name])
  3. Commit your changes (git commit -am 'what this commit will fix/add/improve')
  4. Push to the branch (git push origin [chosen-name])
  5. Create a new Pull Request

๐Ÿ‘จ๐Ÿพโ€๐Ÿ’ป Creator

Rory Hellier - GitHub

๐Ÿ‘๐Ÿฝ Show Your Support

Give a โญ๏ธ if you like this project!

enumerable-methods's People

Contributors

rhelli avatar

Stargazers

 avatar

Watchers

 avatar  avatar

enumerable-methods's Issues

Issue for December 16, 2019

  • The my_all?, my_any?, my_none? lack support for reference values, classes and regular expressions.

  • The my_inject method should do the same as the native method inject when given a value and a symbol. An example highliting the problem:

[1,2,3,4,5].inject(12, :*)
=> 1440
[1,2,3,4,5].my_inject(12, :*)
...
ArgumentError (wrong number of arguments (given 2, expected 0..1))
  • [1,2,3,4,5].my_all?(Intiger) should give true ['saheed', 'oladele', 'suretrust'].my_all?(/d/) should return True

John Carpenter's december morning session

  • Functions won't be able to work with ranges. If I remember correctly, TSE's will test with this and might cause trouble. Enphasis on might

  • You already know this but you can re-use all to finish any / none. Or None for the others two for that matter.

  • My inject returns an enumerator when called this way. puts [2, 4, 5].my_inject(:*)

  • mulitply_else works (as long as my_inject works) if taken out of module Enumerator.

  • Use unless instead of if for negative statements.

  • Code for my_any / my_none / my_all The code on the 'develop' (development) branch should not be broken, but this is not the case. It's missing an end, so it won't readily work for those that pull the branch.

  • About the code on the 'feature/my_inject' branch: "my_all?", "my_any?", "my_none?" lack support for regular expression, classes and example objects.

  • On the positive site, my rspec did not

  • line 94: 'inj_arr = injector + self' -> what would happen if I introduce a symbol as an 'injector' value?

  • line 99: 'print result' is not required inside the method -> maybe switch to implicit return

  • line 91: '*injector' -> how do I know how many parameters I'm recieving? And the type of those parameters?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.