I have a ruby hash:
VALS = { :one => "One", :two => "Two" }
and an Array:
array2 = ["hello", "world", "One"]
Question: How can I populate a new array1 so that it only pulls in any values in array2 that match exactly the values in VALS?
For example, I have tried: array2.each_with_index do |e,i| array1 << e if VALS[i] ~= e end
Along with other thing, and none work. Noob.
Thanks