The values in my hash are either a nested hash:
test_multiple_hash = { test: { another_test: 123 } }
or an array of hashes:
test_multiple_hash = { test: [{ another_test: 123 }, { another_test: 124 }] }
After having fetched a value, I need to use #select to find specific nested hashes:
test_multiple_hash[:test].select { |s| s[:another_test] == 123 }
If my hash has only a single hash, then select doesn't suite my needs unless I convert the single hash into an array.
Is there a better way to find an object by the value to a key when the value to a key in the hash is a single hash or an array of hashes?
test_multiple_hash?