Method: Array#each_pair
- Defined in:
- lib/core/facets/array/each_pair.rb
#each_pair ⇒ Object
Iterate over index and value. The intention of this method is to provide polymorphism with Hash.
6 7 8 9 10 11 |
# File 'lib/core/facets/array/each_pair.rb', line 6 def each_pair #:yield: i = -1 each_value do |x| yield(i+=1, x) end end |