Code from Design Patterns in Ruby