Sha256: 9b520414cdc3b6b58264f50fbfc822a0ffee2e8803921990d6ed34d0925a18c1

Contents?: true

Size: 118 Bytes

Versions: 5

Compression:

Stored size: 118 Bytes

Contents

class Array
  # just like each_with_index
  def map_with_index
    i = -1
    map{ |e| i+=1; yield e, i; }
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
godfat-ludy-0.1.13 lib/ludy/array/map_with_index.rb
ludy-0.1.15 lib/ludy/array/map_with_index.rb
ludy-0.1.13 lib/ludy/array/map_with_index.rb
ludy-0.1.10 lib/ludy/array/map_with_index.rb
ludy-0.1.11 lib/ludy/array/map_with_index.rb