From: Thiago Arrais Date: 2006-04-03T23:55:40+09:00 Subject: Re: Dynamic code generation On 4/2/06, Logan Capaldo wrote: > This seems like a job for class constants: This is what it seemed at first to me too. But I would like the instances to respond to a method, not the classes. The expected behavior is like this $ tail identifiers.rb # calling the identifier method on the instances, not the classes puts A.new.name puts B.new.name puts C.new.name puts A.new.name $ ruby identifiers.rb Class A Class A Class C Class A I wouldn't like to override a method just for returning a different ID. I have solved the problem with the approach described on the previous message. The question is: is there a simpler way? Maybe using class constants? Cheers, Thiago Arrais