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

Chapter 1Closing in on Closures

Chances are you’ve heard about closures and tried to find out what they’re all about. You clicked on the first link, which led you to an utterly incomprehensible Wikipedia entry. Your eyes glazed over terms like lexical scoping and free variables, and you started to think maybe you’re just not that smart. If you are in that situation, here’s some great news. This is totally learnable. You just need to learn a few rules and some new terminology.

In this chapter, you’ll learn the rules that define a closure, so you can identify one when you see it. Knowing these rules will also help you understand the more advanced concepts in the rest of the book. Furthermore, you can transfer these concepts to other languages ...

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