I'd like to build a function "create" that gives me the following capabilities :
zoo=[]
zoo << create(:dog,4)
zoo[0].class #Dog class
myDog=zoo[0].new("foobar") #instance of Dog
myDog.legs #4 legs because my dog is a Dog
zoo[0].class.legs #4
zoo[0].class.superclass #Animal
zoo[0].class.superclass.legs #whatever, but they have legs
"create(:dog,4)" produces a new class Dog that inherits Animal etc
Can you help about this apparently simple metaprogramming question ?