[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[Nuby] Detecting when a class is inherited

Shajith

10/20/2004 5:30:00 AM

Hi 'talk,
Is there any way to detect when a class is inherited? I.e, I wanna
know in the base class when some class inherits from it. I seem to
remember there was some sort of hook for this purpose(it could be just
me, too)

Anyone?

TIA
-Shajith.


2 Answers

Yukihiro Matsumoto

10/20/2004 5:53:00 AM

0

Hi,

In message "Re: [Nuby] Detecting when a class is inherited"
on Wed, 20 Oct 2004 14:30:12 +0900, CT <demerzel@gmail.com> writes:

|Is there any way to detect when a class is inherited? I.e, I wanna
|know in the base class when some class inherits from it. I seem to
|remember there was some sort of hook for this purpose(it could be just
|me, too)

class Derived<Base
end

would call "Base.inherited(Derived)".

matz.


Shajith

10/20/2004 6:11:00 AM

0

Thanks!


On Wed, 20 Oct 2004 14:53:29 +0900, Yukihiro Matsumoto
<matz@ruby-lang.org> wrote:
> Hi,
>
> In message "Re: [Nuby] Detecting when a class is inherited"
> on Wed, 20 Oct 2004 14:30:12 +0900, CT <demerzel@gmail.com> writes:
>
> |Is there any way to detect when a class is inherited? I.e, I wanna
> |know in the base class when some class inherits from it. I seem to
> |remember there was some sort of hook for this purpose(it could be just
> |me, too)
>
> class Derived<Base
> end
>
> would call "Base.inherited(Derived)".
>
> matz.
>
>