From: Trans Date: 2006-11-13T02:40:06+09:00 Subject: Re: Can Ruby do this magic... elegantly J2M wrote: > I got the final solution down to this which I think is rather elegant; > > class Bas < Struct.new :attribute, :another_attribute > class << self > attr_accessor *Bas.members > end > end class Bas < Struct.new :attribute, :another_attribute class << self attr_accessor *members end end Do you realize that you are adding #attribute and #another_attribute at both the instance level and the class level, and niether will reference tha same values? I.e. Bas.attribute = 1 bas = Bas.new bas.attribute = 2 Bas.attribute #=> 1 bas.attribute #=> 2 T.