From: Logan Capaldo Date: 2005-05-04T09:41:55+09:00 Subject: Re: mapping an array to a hash? On 5/3/05, Joel VanderWerf wrote: > class Array > def hashmap > h={} > each {|x| h[x] = yield x} > h > end > end > > [1,2,3].hashmap {|x| x*10} > # => {1=>10, 2=>20, 3=>30} > > Wouldn't it make more sense to put #hashmap in module Enumerable? Just a thought.