Ola Bini, a developer from Stockholm, has rapidly become one of the more prolific Ruby bloggers of late. One of his latest articles looks at Ruby Metaprogramming techniques:
I have been thinking much about Metaprogramming lately. I have come to the conclusion that I would like to see more examples and explanations of these techniques.
Ola looks at singleton classes, Domain Specific Languages, dynamic class generation, using method_missing, method dispatching using patterns, method replacement, null object refactoring, eval, instance variable introspection, procs and blocks, and eval bindings. It's quite a trip and Ola touches on enough topics and gives so many great code examples that no Ruby programmer could fail to pick up a useful tip from this.