Hi,

What you do here is inserting a new Module into the ancestors chain.
(The superclass of class Dog doesn't change, it's still Animal.)  If you
could do the same with a Stuff class (not module), that would be the
right answer to my stupid question.

u.


On Mon, Dec 3, 2012 at 3:43 AM, 7stud -- <lists / ruby-forum.com> wrote:

>
> class Animal
>   def greet
>     puts "Hi, I'm an Animal."
>   end
> end
>
> class Dog < Animal
> end
>
> Dog.new.greet
>


> module Stuff
>   def greet
>     puts 'Hello there.'
>   end
> end
>
> new_superclass = Stuff
> Dog.class_eval("include #{new_superclass}")
> Dog.new.greet
>