Dictionary exercise in Ruby.