source code from Design Patterns in Ruby