Method: Enumerable#map_with_index

Defined in:
lib/musicality/composition/util/biinfinite_sequence.rb

#map_with_indexObject



2
3
4
5
6
7
8
# File 'lib/musicality/composition/util/biinfinite_sequence.rb', line 2

def map_with_index
  return enum_for(:map_with_index) unless block_given?
  ary = entries
  Array.new(ary.size) do |i|
    yield ary[i], i
  end
end