From: Joel VanderWerf Date: 2004-03-03T01:39:45+09:00 Subject: Re: dynamic assignment of instance variables Gerard A.W. Vreeswijk wrote: > Wished we had something like "self.set(k, v)". Ruby ri version 1.8b > does not seem to know of such a method, at least not of a method with > such a name. > > Is it possible to set instances variables without eval or string > interpolation? irb(main):001:0> class C; end => nil irb(main):002:0> c = C.new => # irb(main):003:0> c.instance_variable_set(:@x, 1) => 1 irb(main):004:0> c => #