Hello --

On Thu, 10 Jan 2002 cmlr / math.rochester.edu wrote:

> Sorry, I meant
>
> class Class
>   alias oldNew new
>   private :oldNew
>   def new(*args)
>     instance = oldNew(*args)
>     for v in instance.instance_variables
>       eval "attr_accessor :#{v[1..-1]}"

You can do:

   attr_accessor v[1..-1]

if you don't want to use eval (sez I, delicately skirting the
bigger question of the wisdom of overriding Class#new :-)


David

-- 
David Alan Black
home: dblack / candle.superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav