I have an object of type Hash that I want to execute with hash.each do |key, value| . I would like to get the number of times I went through a loop starting at 1.
Is there a method similar to each that provides this (while still containing the hash key / value data), or do I need to create another counter variable to increment in the loop?
source share