-
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 #626
Numbered Parameters
In a language full of expressive little shorthands, it's time to meet a new idiom! This one makes simple blocks even more concise.

Episode #603
Function Composition Operators
Ruby's support for functional programming has expanded and matured. Join guest chef Devon Estes and learn to use some features added in Ruby 2.6 to quickly and concisely compose functions …

Episode #143: Thread Interruptions
In this episode we finally discover why the Timeout module is unsafe, and a facility new in Ruby 2.0 that makes dealing with thread interruptions much less error-prone.

Episode #122: Testing Blocks With Rspec
Last episode we looked at a simple way to test if a method executes a block as intended that will work in any test framework. But if your tool of …

Episode #121: Testing Blocks
Today's episode answers the question: how do you test that a block passed to a method is executed as intended?

Episode #110: Catch And Throw
A refactoring episode, showing how to replace exceptions-as-flow-control with the "catch" and "throw" methods.

Episode #084: Splat Group
Today we take a look at a related feature to Ruby's "splat" operator: the ability to recursively destructure arrays using grouped assignment.

Episode #081: Implicit Splat
Delving further into Ruby's destructuring assignment, or "splat", mechanism, today we look at some cases where Ruby performs splatting without an explicit '*' operator.