$CalledClass

$CalledClass
is an internal flag used to control the access to a class member. During evaluation of a method, it contains the class the method belongs to.
This loads the package.
In[1]:=
Click for copyable input
We first define a small class hierarchy and a global function to test $CalledClass. Because the class generation checks for global references, we inform it about the reference to a global symbol by means of Import. The Override qualifier signals a change in the parent class functionality.
In[2]:=
Click for copyable input
The global function called has information from where it was called.