From: fedzor Date: 2008-04-14T23:08:34+09:00 Subject: Re: Dynamically referring to a Class On Apr 14, 2008, at 8:41 AM, Eustáquio 'TaQ' Rangel wrote: >> At one point in my application I will be referencing the Class name >> dynamically, I will have it in a String. So e.g. class = >> "Person". I >> want to send the Person class the 'find' message (call Person.find). Also, if you want, you can ditch the string. [ari: ~] irb >> class Array; def self.say_hi; puts "hi"; end; end => nil >> a = Array => Array >> a.say_hihi => nil >> a = Object => Object >> a.say_hi NoMethodError: undefined method `say_hi' for Object:Class from (irb):5 from :0 >> x [ari: ~] Classes are objects too, Remeber.... -------------------------------------------------------| ~ Ari seydar: it's like a crazy love triangle of Kernel commands and C code