No, this is not possible from within ruby.
It is theoretically possible from within the C extension by changing the klass pointer of this object, but it should be noted that this will be completely implementation-specific, will not work for immediate types (i.e. you canβt change the class, for example, fixnum) and may explode different ways.
sepp2k
source share