-
Ruby blocks, fundamentally, are a syntactical expression of a very common idiom: a method, one of whose parameters is a block of code used to pass in behavior.
Why does Ruby have blocks? at Virtuous Code
- Things that Make Blocks Special at RubyTapas
Tag: blocks
Episode #080: Splat Basics
Ruby supports a limited form of destructuring assignment, in the form of the "splat" operator. In today's episode we go over splat basics, in order to lay a foundation for …
Episode #070: Break
In this, the first of two episodes on the 'break' keyword, we look at how it can be applied beyond breaking out of loops.
Episode #036: Blocks, Procs, and Lambdas
How is a Proc different from a Lambda? When do you use one over the other? And how to blocks fit into all this? Today's episode attemptes to answer these …
Episode #032: Hash Default Blocks
Following on to the episodes about #fetch, today's episode answers the question: what do we do when we want the same defaulting behavior everwhere a Hash is used?