From: dblack@... Date: 2007-08-02T04:12:57+09:00 Subject: Re: Ruby Array to Hash (a better way?) Hi -- On Thu, 2 Aug 2007, Kyle Schmitt wrote: > I've been using Ruby for awhile, and I'm afraid I've never used the * > notation... > > I can see that Hash[a] wouldn't work, and that Hash[*a] expands the > array out so that Hash can use it elegantly. > > But what, in a general, does the * do? > > Or is it just for special cases like this? It "un-arrays" its operand; in other words, given an array, the * gives you a list. David -- * Books: RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com)