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

Why This Book?

I have been a Ruby programmer for quite a number of years, but until recently, I had been blissfully ignorant of one of Ruby’s most powerful features. One day, I saw a co-worker casually write a method that took in a block. I realized immediately that I had a major gap in my Ruby knowledge.

That incident left me unsure of my Ruby skills, so I decided to learn as much as I could about Ruby’s blocks. That pursuit also led me to Procs and lambdas.

It didn’t take long to discover that blocks, Procs, and lambdas are Ruby’s implementation of closures, hence the title of this book. The word “closure” sounds like a scary concept, and indeed, throughout my career, I avoided learning about closures. But not this time. I got my hands ...

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