Ruby Pigeondata Color Purple Theo Peter Jr Lucky Grey Theo Peter Jr Ms K White Queenie And Q43892326
RUBY!
- pigeon_data = {
- :color => {
- :purple => [“Theo”, “Peter Jr.”, “Lucky”],
- :grey => [“Theo”, “Peter Jr.”, “Ms. K”],
- :white => [“Queenie”, “Andrew”, “Ms. K”, “Alex”],
- :brown => [“Queenie”, “Alex”]
- },
- :gender => {
- :male => [“Alex”, “Theo”, “Peter Jr.”, “Andrew”,”Lucky”],
- :female => [“Queenie”, “Ms. K”]
- },
- :lives => {
- “Subway” => [“Theo”, “Queenie”],
- “Central Park” => [“Alex”, “Ms. K”, “Lucky”],
- “Library” => [“Peter Jr.”],
- “City Hall” => [“Andrew”]
- }
- }
The data above is organized by attributes – :color, :gender, and:lives, each a hash. Within these hashes are arrays of pigeonnames.
We want this data, but in a different structure. Rather thansorting by attributes, your task is to create a hash wherepigeon names are the keys, with each name pointing to ahash of their attributes.
Expert Answer
Answer to RUBY! pigeon_data = { :color => { :purple => [“Theo”, “Peter Jr.”, “Lucky”], :grey => [“Theo”, “Peter Jr.”, “Ms. K”], :…
OR