Sha256: 7a5253828644ea84e86071d05f1cbd50fb788529b93e5cfae45970e35d682dd8
Contents?: true
Size: 140 Bytes
Versions: 1
Compression:
Stored size: 140 Bytes
Contents
class Array def invert(&block) h = {} self.each_with_index do |x, i| h[x] = block ? yield(x, i) : i end h end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fathom-0.5.0 | lib/ext/array.rb |