Ruby metaprogramming: blocks, bindings, dynamic methods