Check out example codes for "ruby map hash". It will help you in understanding the concepts better.

Code Example 1

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

hash.map { |k,v| [k, v.to_sym] }.to_h
# {:bacon=>:protein, :apple=>:fruit}

Learn ReactJs, React Native from akashmittal.com