Mastering Ruby Closures

A Guide to Blocks, Procs, and Lambdas



Bookstore > Books > Mastering Ruby Closures

Price$22.99 - $32.11
Rating
AuthorBenjamin Tan Wei Hao
PublisherThe Pragmatic Programmers
Published2017
Pages94
LanguageEnglish
FormatPaper book / ebook (PDF)
ISBN-101680502611
ISBN-139781680502619
EBook Hardcover Paperback

Ruby developers use the Ruby language as the yardstick for expressivity, flexibility, and elegance - and a large part of this is due to blocks, lambdas, and procs. These language features make Ruby one of the most beautiful and pleasant languages to work with. Learn how to understand and craft code that will take you closer to Ruby mastery.

Start with the basics of closures and then dive into blocks, as you learn about the patterns that involve blocks, and how they are used in real-world code. Then create and use procs and lambdas. Finally, build your own lazy enumerables with advanced Ruby features such as fibers and generators. Along the way, work with computer science concepts such as closures, free variables and first-class functions. Spot a closure easily. Identify the patterns where you can effectively use blocks and re-implement common standard library methods using them. Trace through how Symbol#to_proc works and find out the different ways of calling procs. This succinct guide takes you through the different kinds of Ruby closures with engaging examples, and each chapter comes with exercises that test and challenge your understanding.

When you finish this book, blocks, procs, and lambdas will have become an integral part of your Ruby toolbox.





4 5 18

Similar Books


Computer Science Programming Basics in Ruby

Computer Science Programming Basics in Ruby

by Ophir Frieder, Gideon Frieder, David Grossman

If you know basic high-school math, you can quickly learn and apply the core concepts of computer science with this concise, hands-on book. Led by a team of experts, you'll quickly understand the difference between computer science and computer programming, and you'll learn how algorithms help you solve computing problems.Each chapter bui...

Price:  $19.99  |  Publisher:  O'Reilly Media  |  Release:  2013

Ruby Pocket Reference, 2nd Edition

Ruby Pocket Reference, 2nd Edition

by Michael Fitzgerald

Updated for Ruby 2.2, this handy reference offers brief yet clear explanations of Ruby's core elements - from operators to blocks to documentation creation - and highlights the key features you may work with every day. Need to know the correct syntax for a conditional? Forgot the name of that String method? This book is organized to help ...

Price:  $11.90  |  Publisher:  O'Reilly Media  |  Release:  2015

Ruby Under a Microscope

Ruby Under a Microscope

by Pat Shaughnessy

Ruby is a powerful programming language with a focus on simplicity, but beneath its elegant syntax it performs countless unseen tasks.Ruby Under a Microscope gives you a hands-on look at Ruby's core, using extensive diagrams and thorough explanations to show you how Ruby is implemented (no C skills required). Author Pat Shaughnessy takes ...

Price:  $23.99  |  Publisher:  No Starch Press  |  Release:  2013

Ruby Performance Optimization

Ruby Performance Optimization

by Alexander Dymo

You don't have to accept slow Ruby or Rails performance. In this comprehensive guide to Ruby optimization, you'll learn how to write faster Ruby code - but that's just the beginning. See exactly what makes Ruby and Rails code slow, and how to fix it. Alex Dymo will guide you through perils of memory and CPU optimization, profiling, measur...

Price:  $26.81  |  Publisher:  The Pragmatic Programmers  |  Release:  2015

Mastering Git

Mastering Git

by Jakub Narebski

Git is one of the most popular types of Source Code Management (SCM) and Distributed Version Control System (DVCS). Despite the powerful and versatile nature of the tool enveloping strong support for nonlinear development and the ability to handle large projects efficiently, it is a complex tool and often regarded as "user-unfriendly...

Price:  $39.99  |  Publisher:  Packt Publishing  |  Release:  2016

Mastering Puppet 5

Mastering Puppet 5

by Ryan Russell-Yates, Jason Southgate

Puppet is a configuration management system and a language written for and by system administrators to manage a large number of systems efficiently and prevent configuration drift.The core topics this book addresses are Puppet's latest features and mastering Puppet Enterprise. You will begin by writing a new Puppet module, gaining an unde...

Price:  $44.99  |  Publisher:  Packt Publishing  |  Release:  2018

Mastering phpMyAdmin 3.4 for Effective MySQL Management

Mastering phpMyAdmin 3.4 for Effective MySQL Management

by Marc Delisle

Mastering phpMyAdmin 3.4 for Effective MySQL Management is an easy-to-read, step-by-step practical guide that walks you through every facet of this legendary tool - phpMyAdmin - and takes you a step ahead in taking full advantage of its potential. This book is filled with illustrative examples that will help you understand every phpMyAdmi...

Price:  $23.99  |  Publisher:  Packt Publishing  |  Release:  2012

Programming Cocoa with Ruby

Programming Cocoa with Ruby

by Brian Marick

Programming Cocoa with Ruby brings together two enthusiastic development communities. Ruby programmers will tell you how productive they are with just the right amount of code. Cocoa developers know the importance of a clean, intuitive interface.Now, through Programming Cocoa with Ruby, the joy of Cocoa meets the joy of Ruby....

Price:  $4.90  |  Publisher:  The Pragmatic Programmers  |  Release:  2009