If you like to know Index of each iteration you could use .each_with_index
hash.each_with_index { |(key,value),index| ... }
If you like to know Index of each iteration you could use .each_with_index
hash.each_with_index { |(key,value),index| ... }