[Cuis] Is there a cleaner way to determine if a method was called by a subclass?

Juan Vuletich juan at jvuletich.org
Fri May 1 17:24:21 CDT 2015


Hi Phil,

You can do:

cMethod
     ^thisContext methodClass == self class

This will answer true if run on the class that defines the method, and 
false if inherited.

Cheers,
Juan Vuletich

On 5/1/2015 6:28 PM, Phil (list) wrote:
> Let's say I have a class Foo with class method aMethod and a subclass
> Bar, is there a way to determine whether or not aMethod is being called
> by the parent class other than:
> aMethod
> 	^ self name = #Foo
>
> i.e. I'd like to avoid referencing the class name if possible.  Is there
> an introspective call I could use to accomplish this?
>
>
> _______________________________________________
> Cuis mailing list
> Cuis at jvuletich.org
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>





More information about the Cuis mailing list