Ruby Closures Book by Benjamin Tan Wei Hao [PDF/iPad/Kindle]
The Ruby Closures Book
The Ruby Closures Book
The Ruby Closures Book

This book is 80% complete

Last updated on 2015-04-26

About the Book

NOTE: This book will go under the Pragmatic Programmers' imprint! Stay tuned!

I have been a Ruby programmer for quite a number of years, but until recently, I have been blissfully ignorant of one of Ruby's most powerful features. That is, until one day, I saw a co-worker casually write a method that took in a block. Holy ****! I realized at that moment, I had a major gap in my Ruby knowledge.

Sure, I knew how to use blocks, and vaguely knew how to use lambdas in Rails scopes. But who was I kidding? I was never going to be a competent Ruby programmer if I didn't fix this.

Here's the thing. I spoke to a few of my Ruby programmer friends, and guess what, the situation is the same. If you are like that then this book is for you.

This book will help you gain a deep understanding of Ruby's closures, and more importantly, how to harness its power.

What you will learn:

  • What are closures?
  • Why and how are closures useful?
  • The differences between lambdas and procs
  • Ruby patterns using blocks
  • Real-world examples of closures
  • Implement your own testing framework, lazy enumerables and DSLs
  • And much more ...

The Story Behind the Book

I was honeymooning with my wife in Taiwan. As I was waiting for her outside the bathroom up at some mountain, it dawned upon me that "" would make for a fantastic domain name. But since that was too general, why not "" instead? I congratulated myself on being an absolute genius, and immediately proceeded to buy that domain. I began writing the book the very next day. Thankfully, my wife didn't complain.

About the Author

Benjamin Tan Wei Hao
Benjamin Tan Wei Hao

Ohai! I'm Benjamin. I am a software engineer at Neo Innovation. I absolutely love Ruby. Even after using it for years, I still find so much more to learn. You can read some of my articles on Ruby on SitePoint.

I live in Singapore with my wonderful wife. I am currently working on another book. (If you are into Elixir, you'll love it.)

If you have any questions at all, I'm an email away.

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Write and Publish on Leanpub

Authors and publishers use Leanpub to publish amazing in-progress and completed ebooks, just like this one. You can use Leanpub to write, publish and sell your book as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub