From: Frank Hirsch <0ffh@...> Date: 2006-05-06T18:08:24+09:00 Subject: Record good idea? Hija! I have made a little record class, because I needed it. Maybe anyone finds this useful, or wants to beat me, because I have overtreaden some unwritten Ruby rule... :-))) >---------------- cut here ----------------< class Record =begin Little record class. (w) Frank Hirsch 2006 =end def method_missing(*a) if (a.length!=2) super elsif (a[0].class!=Symbol) super else name=a[0].id2name value=a[1] eval("@"+name+"value",binding) eval("def "+name+"(v);@"+name+"v;end") name.chop! eval("def "+name+";@"+name+";end") end end def initialize end end >---------------- and here ----------------< Okay, what does anybody think? Useful or heresy or just an old hat? Regards, 0ffh -- Posted via http://www.ruby-forum.com/.