Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/apocalypse-client.rb
Class Method Summary collapse
-
.zip(keys, values, default = nil, &block) ⇒ Object
Create a hash from an array of keys and corresponding values.
Class Method Details
.zip(keys, values, default = nil, &block) ⇒ Object
Create a hash from an array of keys and corresponding values.
13 14 15 16 17 |
# File 'lib/apocalypse-client.rb', line 13 def self.zip(keys, values, default=nil, &block) hsh = block_given? ? Hash.new(&block) : Hash.new(default) keys.zip(values) { |k,v| hsh[k]=v } hsh end |