Sha256: 5c26f71876fb41e9499b6bac21c783f9b5064233595dfe8e9649b5b9f26f374b
Contents?: true
Size: 218 Bytes
Versions: 21
Compression:
Stored size: 218 Bytes
Contents
# http://snippets.dzone.com/posts/show/5119 class Array def map_with_index! each_with_index do |e, idx| self[idx] = yield(e, idx); end end def map_with_index(&block) dup.map_with_index!(&block) end end
Version data entries
21 entries across 21 versions & 1 rubygems