Hi --

On Thu, 2 Nov 2006, Afonov, Max wrote:

> Hi All,
>
> I was wondering whether it's at all possible to change the class of
> an already existing object. This is purely theoretical, so forgive
> me if this is against all the best practices.

No, an object retains its "birth class" forever.  I think there might
be some 3vi1 libraries out there that manage to bring this about :-)
But the basic design is that the class doesn't change.  (Of course you
can change literally everything about the object's actual behavior,
what methods it has, etc.).


David

-- 
                   David A. Black | dblack / wobblini.net
Author of "Ruby for Rails"   [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB's Weblog)        [2] | Co-director, Ruby Central, Inc.   [4]
[1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com    | [4] http://www.rubycentral.org