Perfect! Our program is really coming along.
You might have wondered how we’re going to get our movies and ratings from the user—which come in as strings—into the hash where we want our movies to be symbols and our ratings to be integers. Built-in Ruby magic to the rescue!
.to_sym method can convert a string to a symbol, and
.to_i will convert a string to an integer.
.to_sym on your
.to_i on your
rating so that your movie titles are stored as symbols in the hash and the associated ratings are stored as integers.