From: Im still Date: 2009-08-20T04:07:06+09:00 Subject: Class name as a variable --001517510b702cb1ca0471835726 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi all I'm thinking about a question, that is : Several classes will have a method in a same name (probably do same thing too). then in a program I want the method calling class name coming from a variable( or maybe a result of a expr). for example: class A def abc end end class B def abc end end #what i want to do is something like a = a_variable.abc # a_variable = A | B Now I'm doing this by a = eval(" #{a_variable}.abc ") My question is, is there any better (or nicer) way to doing this? Thanks :) --001517510b702cb1ca0471835726--