Skip to content

Instantly share code, notes, and snippets.

@sirramongabriel
Created September 8, 2013 19:27
Show Gist options
  • Select an option

  • Save sirramongabriel/6487681 to your computer and use it in GitHub Desktop.

Select an option

Save sirramongabriel/6487681 to your computer and use it in GitHub Desktop.
Spotlight on the first case statement.
case choice
when 'add'
puts "What movie do you want to add?"
title = gets.chomp
if movies[title.to_sym].nil?
puts "What's the rating? (Type a number 0 to 4.)"
rating = gets.chomp
movies[title.to_sym] = rating.to_i
puts "#{title} has been added with a rating of #{rating}."
else
puts "That movie already exists! Its rating is #{movies[title.to_sym]}."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment