Ruby: How do you trigger something only when inherited by a non-abstract class?

You may have to put your ordered_tree call in the Dog class. There is also the self. Included method, but that runs everything within the scope of the parent class, though it passes in the child class as a parameter.So, maybe you could do something like.

You may have to put your ordered_tree call in the Dog class. There is also the self. Included method, but that runs everything within the scope of the parent class, though it passes in the child class as a parameter.So, maybe you could do something like: module Animal class Base Send('ordered_tree') end end end I haven't tried this myself and suspect you may run into the same problem (ordered_tree still running in context of Base) but it's worth a shot...

Great! Thanks. I ended up doing exactly what you placed, except I added super right below chld.

Send(...). I got errors without it, I suppose because Rails does other stuff with self. Included that was overwritten without super.

– Ramon Tayag Jun 7 at 14:14 I mean self.inherited. – Ramon Tayag Jun 9 at 4:28.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions