From: "Marcel Molina Jr." Date: 2006-01-09T07:59:58+09:00 Subject: Re: Passing a hash of args On Mon, Jan 09, 2006 at 07:55:42AM +0900, Jonathan Leighton wrote: > Is there a way to pass each item is a hash as a successive argument to a > function? > > ie: > > time = { > :year => 2003 > :month => 03 > :day => 24 > } > Time.local(time) > > (that wouldn't work but you get the idea) Hashes aren't ordered. Otherwise you could just do Time.local(*time.values). Time.local(*[:year, :month, :day].map {|key| time[key]}) is DRYer but more typing than Time.local(time[:year], time[:month], time[:day]) I look forward to someone else coming up with something clever. marcel -- Marcel Molina Jr.