From: James Edward Gray II Date: 2006-01-09T08:01:22+09:00 Subject: Re: Passing a hash of args On Jan 8, 2006, at 4:55 PM, 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) Well, Hashes are unordered by definition, but as long as we declare an order it's doable: >> time = { ?> :year => 2003, ?> :month => 03, ?> :day => 24 >> } => {:month=>3, :year=>2003, :day=>24} >> Time.local(*time.values_at(:year, :month, :day)) => Mon Mar 24 00:00:00 CST 2003 Hope that helps. James Edward Gray II