I have a hash:
{
"grey" => ["anf_94748_01_prod1", "anf_94748_01_model1", "anf_94748_01_model2"],
"heather blue" => ["anf_106537_01_prod1", "anf_106537_01_model1", "anf_106537_01_model2"],
"indigo" => [],
"dark grey" => ["anf_94747_01_prod1"]
}
How can I replace its values according to an array of image ids:
[317, 318, 319, 320, 340, 358, 365]
If hash array is empty, then skip it and go to the next hash key, and assign id to that image. Desired output will be:
{
"grey" => [317, 318, 319],
"heather blue" => [320, 340, 358],
"indigo" => [],
"dark grey" => [365]
}
h = { "grey"=>...}.