From: James Coglan Date: 2009-02-01T05:47:14+09:00 Subject: Re: Array#to_h --001485f7909e19db9c0461cd6d21 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/1/31 Joshua Ballanco > See here: > http://www.fivesevensix.com/posts/2005/05/20/array-to_h > > ...and here: > http://drawohara.com/post/70998078/ruby-array-to-hash-rocks > > - Josh This question came up a while back where I helped someone with yet another interpretation: http://blog.jcoglan.com/2008/09/08/enumerableto_hash-for-unix-style-flags-in-ruby-methods/ The core problem with Hash#to_a and any possible Enumerable#to_h is it's not intuitively obvious what either should do, though Hash#to_a is possibly slightly narrower in scope. There are any number of ways you might want to map one to the other, and that's really what map() and inject() are for. --001485f7909e19db9c0461cd6d21--