From: Trans Date: 2008-03-28T00:28:58+09:00 Subject: Re: instance_variable_[gs]et On Mar 27, 8:23 am, Florian Gilcher wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Mar 27, 2008, at 5:36 AM, Trans wrote: > > > > > And why can't #instance_variable_set take a hash to set more than one > > variable at a time? > > > T. > > By the way, if you really need it, it is easily implemented on your own: > Example: > > def set_instance_variables(variables) > variables.each do |key, value| > instance_variable_set("@#{key}", value) > end > end Yes, of course. Facets has #instance_assign, but it just seems wasteful when one method could do. I don't quite get matz take. How is variables.each do |key, value| instance_variable_set("@#{key}", value) end cleaner than instance_variable_set(variables) T.