I am trying to simulate Eiffel’s ability to make methods in a class only
available to specific other classes. I know it is probably impossible to
make methods only visible to certain other classes, but is there a way
to make a class throw an exception if called by the wrong class?
if calling_class.class != some_other_class.class
â?¦rest of class
Specifically is there a way to see what the class of whatever is calling
a method is (like the variable ‘calling_class’ above)? Or does anyone
know of a project that simulates this functionality?