Module: Enumerable

Defined in:
lib/array_extensions.rb

Overview

for 1.9, zip is defined on Enumerable

Instance Method Summary collapse

Instance Method Details

#to_hashObject



25
26
27
28
29
# File 'lib/array_extensions.rb', line 25

def to_hash
  {}.affect do |hash|
    self.each { |pair| hash[pair.first] = pair.last }
  end
end