O'Reilly logo

Mastering Ruby Closures by Benjamin Tan Wei Hao

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Wrapping Up

Lazy enumerables seem magical when you first encounter them. In fact, even when you start unravelling the pieces that make up lazy enumerables, you will undoubtedly find interesting bits of Ruby that you might not have otherwise encountered.

Before writing this chapter, I had never encountered the Enumerator::Yielder, Enumerator::Generator, or Fiber classes. Thankfully, the Rubinius implementation of Enumerable[6] was a great help. Learning about the behavior of Fiber.yield was the “aha!” moment for me.

What’s Next

Ruby is a language that goes the extra mile to provide syntax that tries to do a lot with little ceremony, yet somehow manages to find just the right balance to make things very readable.

Beneath the pretty syntax ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required