Answers for "ruby hash to array of hashes"

0

ruby map hash

hash = { bacon: "protein", apple: "fruit" }

hash.map { |k,v| [k, v.to_sym] }.to_h
# {:bacon=>:protein, :apple=>:fruit}
Posted by: Guest on August-26-2020

Code answers related to "ruby hash to array of hashes"

Browse Popular Code Answers by Language