From: cmlr@... Date: 2002-01-11T01:42:51+09:00 Subject: Re: instance variables automatically accessible? Thanks very much!. Carl Mueller Mathieu Bouchard wrote: > On Thu, 10 Jan 2002 cmlr@math.rochester.edu wrote: >> Does anyone know the best way to make instance variables in a class >> automatically accessible? In other words, how do you avoid writing >> attr_accessor :a, :b, :c > class Class > alias oldNew new > private :oldNew > def new(*args) > o = oldNew(*args) > unless @attribs_created > for v in o.instance_variables > attr_accessor v[1..-1].intern > end > @attribs_created=true > end > o > end > end