Sha256: 59f0ee348f48f3d870c56ddbc7c27436641f52912cac895b6115e49dbf1051f6
Contents?: true
Size: 347 Bytes
Versions: 11
Compression:
Stored size: 347 Bytes
Contents
class Hash # Creates a new hash from two arrays --a keys array and # a values array. # # Hash.zipnew(["a","b","c"], [1,2,3]) # #=> { "a"=>1, "b"=>2, "c"=>3 } # # CREDIT: Trans, Ara T. Howard def self.zipnew(keys,values) # or some better name h = {} keys.size.times{ |i| h[ keys[i] ] = values[i] } h end end
Version data entries
11 entries across 11 versions & 1 rubygems