My solution to exercise 45 of Zed Shaw's Learn Ruby the Hard Way