RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Creating Ruby enumerators on the fly

When you treat your collections as enumerators, you get to use all your favorite functions like #map and #reduce without having to write any extra code. In this post I show you how easy it is to create enumerators on the fly, without defining extra classes or messing around with the Enumerable module. http://blog.honeybadger.io/creating-ruby-enumerators-on-the-fly/

Comments

Lovely, tiny example. You might also enjoy reading: http://blog.arkency.com/2014/01/ruby-to-enum-for-enumerator/ :)

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in