Created
February 28, 2014 21:07
-
-
Save wannabefro/9279948 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'pry' | |
data = JSON.parse(IO.read('movies_data.json')) | |
# cast_members = data['movies'][0]['abridged_cast'] | |
# cast_member_names = cast_members.map{|member| member['name']} | |
all_cast_members = [] | |
all_cast_characters = [] | |
movies = data['movies'] | |
movies.each do |movie| | |
# puts "The movie is #{movie['title']}" | |
movie['abridged_cast'].each do |member| | |
# puts "The actor/ress is #{member['name']}" | |
all_cast_members << member['name'] | |
end | |
end | |
# puts all_cast_members | |
# movies.each{|movie| puts movie['title']} | |
movies.each do |movie| | |
# puts "The movie is #{movie['title']}" | |
movie['abridged_cast'].each do |member| | |
if member['name'] == 'Eva Green' | |
puts "Eva Green stars in #{movie['title']}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment