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