I recently gave a talk at both NYC.rb and DCRUG about some great features of Enumerable that deserve more attention. I touch on interesting use cases for using Enumerable and Enumerator including API client libraries, streaming HTTP, web crawlers, CSV parsing, and infinite sequences.

I put together a bunch of code samples for the talk and assembled them in a repository on GitHub:


To run a sample, clone the repo and install the gems:

$ git clone https://github.com/rossta/loves-enumerable.git
$ cd loves-enumerable
$ bundle install

Then simply run the code with the ruby executable.

$ ruby code/pascals_triangle.rb

You'll get the most out of this repo by inspecting the source along with following the presentation.

If you liked this presentation, share it on Twitter and follow me.

Need help with JavaScript on Rails?

My name is Ross Kaffenberger.

I teach full stack web developers about frontend tools and performance, especially at the intersection of JavaScript and Ruby on Rails.

Subscribe to stay in the loop.