The Enumerable module is one of my favorite parts of Ruby. It allows us to perform operations like #each, #map, #inject, and #any? on collection objects, most notably Array. It’s all much cleaner, readable, and semantic than the nested for loops I used to write in other languages. Enumerable is made possible by leveraging one of Ruby’s more powerful constructs: blocks. They typically take the form
![Blocks, Procs, and Enumerable](https://cdn-ak-scissors.b.st-hatena.com/image/square/beac31a4be8e4962e2fefc94fd70b667eb3e9cec/height=288;version=1;width=512/https%3A%2F%2Fimages.thoughtbot.com%2Fblog-images%2Fsocial-share-default.png)