From: Austin Ziegler Date: 2003-12-05T13:45:36+09:00 Subject: Re: Dumb question to which I ought to know the answer by now On Fri, 5 Dec 2003 12:42:05 +0900, Mark J. Reed wrote: > Is there an assignment version of Hash#values_at, so I can assign > multiple keys at once? Something like this: > > hash.set([:a, :b, :c], [1,2,3]) > > > such that I end up with hash[:a] = 1, hash[:b] = 2, and hash[:c] = 3. > > > Easy enough to write, but it'd be silly to do so if it's already there. > > > -Mark hash = { :a => 3, :b => 2, :c => 1, :d => 0} hash.update({ :a => 1, :b => 2, :c => 3 }) -austin -- austin ziegler * austin@halostatue.ca * Toronto, ON, Canada software designer * pragmatic programmer * 2003.12.04 * 23.43.54