From http://ruby.learncodethehardway.org/.