Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/extensions/hash.rb

Overview

the following extension for class Hash is needed (from Facets of Ruby library):

Class Method Summary collapse

Class Method Details

.zip(keys, values) ⇒ Object

from Facets of Ruby library


4
5
6
7
8
# File 'lib/extensions/hash.rb', line 4

def self.zip(keys,values) # from Facets of Ruby library
  h = {}
  keys.size.times{ |i| h[ keys[i] ] = values[i] }
  h
end