From: Markus Jais Date: 2002-06-03T21:37:54+09:00 Subject: Re: dynamic attr_accessor?? nobu.nokada@softhome.net wrote: > Hi, > > At Mon, 3 Jun 2002 20:31:22 +0900, > Markus Jais wrote: >> I like to create methods for my class dynamically based on >> strings I pass to initialize > > class Cl > def initialize(name) > class << self;self;end.class_eval {attr_accessor name} > end > end > thanks! one more question. what is the "self" between "class << self;" and "end.clas_eval..." good for??? it does not work without it, but I do not understand how this works. markus