If a class has been previously defined, how can I tell it to inherit from a class Parent
?
For instance:
class Parent
..
end
class Klass
..
end
Now I want it to inherit from Parent
.
I can't re-open the class and set it because I will get a class mismatch error:
class Klass < Parent
..
end
Specifically, I am trying to find out how to set the class inheritance on a class I am creating through Object.const_set
.
klass = Object.const_set('Klass', Class.new)
How can I tell Klass
to inherit from class Parent
?