an exercise in object oriented programming in ruby