Ruby Unblocked
summary
Explains that blocks are Ruby's closure with an environment pointer ladder that enables dynamic variable access, and that RSpec failure comes from class_eval changing self so helper methods become unavailable (fix: stash the helper in a local variable). Shows lambdas allocate a copy of the stack frame on the heap, increasing memory, and uses binding/eval to inspect environments. Benchmarks show block/lambda paths are about twice as slow (10,000-iteration tests) and define_method creation/execution costs ~1.5–2× vs def.
AI-written summary · about
chapters (27)
- 0:00Intro
- 0:22Cape Town
- 0:54Water Crisis
- 1:52Emma
- 2:45Example
- 3:32Solution
- 4:02First theory
- 5:25Fifth theory
- 6:07What is a block
- 6:46What is the block
- 8:18Display strings method
- 8:41Stack frame
- 9:48Environment pointer
- 10:10Normal method call
- 10:32Method with a block
- 14:30Why does this work
- 14:58Ruby Block Object
- 19:02Class Evil
- 21:06Find Method
- 22:40Block Method
- 24:01Benchmark
- 25:14Lambdas
- 28:13Lambda on heap
- 33:03Binding object
- 34:37Fan method
- 35:18Benchmarking
- 36:57Conclusion








