I have a hash
h = {a=> 1, b=> 2, c=> 3}
and an array
a = [a, b]
Is it possible to use
h.select {|k,v| k == array_here?}
To select all elements from the array that exists in the hash?
I Found the Solution
h.select {|k,v| a.include?(k) }
I have a hash
h = {a=> 1, b=> 2, c=> 3}
and an array
a = [a, b]
Is it possible to use
h.select {|k,v| k == array_here?}
To select all elements from the array that exists in the hash?
I Found the Solution
h.select {|k,v| a.include?(k) }