You can't, that's a limitation of the language, unfortunately.
Tobie
On Feb 6, 9:51 am, Herr Ernst <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a question.
> How is it possible in Prototype to determine the class of an object
> (i.e. constructor).
> Example:
> I define a class:
> "Car=Class.create({})"
> Then I instantiate it:
> "benz=new Car()"
>
> So and now I want to know what class benz is. I know I can do "benz
> instanceof Car" which returns true. But how can I get the class
> directly (I have many classes and don't want to compare every object
> with every class)?
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---