Sha256: f90ec8d497afb2f277fe0fa981355194cba2ab0eae6006f1afc4b2247531a789
Contents?: true
Size: 293 Bytes
Versions: 17
Compression:
Stored size: 293 Bytes
Contents
class Array #-- # Taken from http://snippets.dzone.com/posts/show/302 # # >> %W{ a b c }.to_hash_with( %W{ 1 2 3 } ) # => {"a"=>"1", "b"=>"2", "c"=>"3"} #++ def to_hash_with(other) Hash[ *(0...self.size()).inject([]) { |arr, ix| arr.push(self[ix], other[ix]) } ] end end
Version data entries
17 entries across 17 versions & 1 rubygems