Skip to content

Instantly share code, notes, and snippets.

@ootoovak
Last active July 23, 2021 05:56
Show Gist options
  • Save ootoovak/3b9107b34bc54fd73ee7 to your computer and use it in GitHub Desktop.
Save ootoovak/3b9107b34bc54fd73ee7 to your computer and use it in GitHub Desktop.
Ruby Array, Hash, and Enumerable to start with

Ruby Array, Hash, and Enumerable methods

What is this?

This is a list of methods from Ruby's Array, Hash, and Enumerable that I find useful and have used a lot. It is by no means an complete list so just think of it as a starting point. (BTW, Enumerable is a mixin and not a class but both Array and Hash include it they both have Enumerable methods avaliable to them.)

In preperation for this week and the upcoming week make sure you are understand how to sort and filter each of these data structures. Read the documentation on these methods and play with them in IRB.

After you are familiar with each one of these methods try out a few more. Read through the method lists of each and read up on any that you think might be useful or ones you can't tell what they do. One "lifehack" I have heard of is setting one of these pages as your new-tab homepage on your browser. They every so often you might pick up a new method.

As will all of EDA we will be building on top of you knowledge as you go. These methods are the foundations that will make your life easier later on.

Array

Start Here

Some More

Hash

Start Here

Some More

Enumerable

Start Here

See More

@desnor
Copy link

desnor commented Mar 23, 2015

Hey Samson - none of these links seem to be going to the actual method, just to a broken link at Ruby-doc.org....

@amelialaundy
Copy link

@alexrevell ive fixed it up, the docs have moved to ruby 2.2.0 so the links were wrong 😄
https://gist.github.com/amelialaundy/a977e5a6c9554e4c410b

@ootoovak
Copy link
Author

Fixed the above links now to point to core-2.0.0 rather than core-2.0 which was the old URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment