Skip to content

Instantly share code, notes, and snippets.

@Sihui
Last active August 4, 2017 07:22
Show Gist options
  • Select an option

  • Save Sihui/9c1c944334cdb52fe89834393acbac74 to your computer and use it in GitHub Desktop.

Select an option

Save Sihui/9c1c944334cdb52fe89834393acbac74 to your computer and use it in GitHub Desktop.
Design Pattern: Iterator and Movie Collections
amazon_movies = {
0 => {
title: 'Mission: Impossible - Rogue Nation',
year: '2015',
director: 'Christopher McQuarrie',
genre: 'Thriller/Actio',
length: '2h 11m'
},
1 => {
title: 'The Hunger Games: Mockingja',
year: '2014',
director: 'Francis Lawrence',
genre: 'Fantasy/Science fiction film',
length: '2h 3m'
},
2 => {
title: 'Room',
year: '2015',
director: 'Lenny Abrahamson',
genre: 'Drama film/Thriller',
length: '1h 58m'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment