ruby-blocks-procs-lambdas
Installation
SKILL.md
Ruby Blocks, Procs, and Lambdas
Master Ruby's functional programming features with blocks, procs, and lambdas. These are fundamental to Ruby's expressive and elegant style.
Blocks
Basic Block Syntax
# Block with do...end (multi-line)
[1, 2, 3].each do |num|
puts num * 2
end
# Block with {...} (single line)
[1, 2, 3].each { |num| puts num * 2 }