Skip to content

Instantly share code, notes, and snippets.

@egrueter-dev
Last active August 29, 2015 14:14
Show Gist options
  • Save egrueter-dev/baf5590a08ebce4647a9 to your computer and use it in GitHub Desktop.
Save egrueter-dev/baf5590a08ebce4647a9 to your computer and use it in GitHub Desktop.
Favorite_Movies - Launch Exercise
#Using the array of hashes above, output the titles, along with their year to achieve the following output.
# 1998: The Big Lebowski
# 1980: The Shining
# 1990: Troll 2
favorite_movies = [
{ title: 'The Big Lebowski', year_released: 1998, director: 'Joel Coen', imdb_rating: 8.2 },
{ title: 'The Shining', year_released: 1980, director: 'Stanley Kubrick', imdb_rating: 8.5 },
{ title: 'Troll 2', year_released: 1990, directory: 'Claudio Fragasso', imdb_rating: 2.5 }
]
favorite_movies.each do |movie|
puts "#{movie[:year_released]} : #{movie[:title]}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment