From: Holden Glova Date: 2002-06-05T18:29:53+09:00 Subject: Re: dynamic attr_accessor?? On Wed, 05 Jun 2002 01:19, you wrote: > "Holden Glova" wrote in > .... > > > I personally prefer the non-eval way that Guy Decoux recommend of using > > type.__send__. Try and not use eval whenever you can IMO - plus I think > > the > > > clarity is enhanced in many non-eval solutions. > > The ``type'' solution defines new A instances methods wether you use > class_eval or send - > > > irb(main):019:0> class A > > irb(main):020:1> def initialize(name) > > irb(main):021:2> @name = name > > irb(main):022:2> type.__send__(:attr_accessor, "name") > > class << self; self end.send(:attr_accessor, name) > > > irb(main):023:2> end > > .... > > /Christoph I don't understand, can you please explain? -- Signed, Holden Glova