I have an array (array1) of hashes that looks like this :
array1 = [
{:ID=>"1", :value=>"abc"},
{:ID=>"2", :value=>"def"}
]
I can loop over each hash and check each hash value manually:
array1.each do |h|
if h.has_value?("def")
#do something
end
end
Is there a way to check if the hash value "abc" exists within a hash inside the array without having to iterate over the array?