What is the quickest way in Ruby to retrieve the correct hash by language from the following nested hash:
COUNTRIES = {
"DE" => {:currency => "EUR", :tax_rates => [19, 7], :languages => ["de-de"]},
"US" => {:currency => "USD", :tax_rates => [10], :languages => ["en-us"]}
}
I managed to retrieve the correct hash by providing the currency:
COUNTRIES.select{|key, hash| hash[:currency] == "USD" }
But how can I query by a language, for example by en-us?
Thanks for any help.