Ruby Metaprogramming Episode 3: Dynamic Code
Metaprogramming is sometimes defined as “writing code that writes code.” Here we’ll see just how to do that in Ruby.
- Blocks and the two kinds of block-objects
- How bindings capture execution context
- How blocks can act as closures, and why that’s vital to metaprogramming
- Writing methods that define other methods using nested
- Writing your own accessor methods