I'm a bit new to programming and didn't really know how to search for the answer to this particular problem so I thought I'd share an example to get my point across. I'm currently writing a script that will add an instance of my class (named applicant) to a mongo database elsewhere. My problem is that in many of my methods, I need to return the name of a class from a function such that the returned value can be used as a parameter in another call. Here's an example
modelName = get_class().getModelName()
In the above code, I am trying to retrieve the name of a particular data-model in question. My idea for this was to write two methods, one for returning the name of the class where the model name can be found, and another for returning the actual model name. This is done in an abstract class so that the functionality of my subclasses can be generalized (otherwise I would just put the model name and class name directly). What I'm unsure about is how to write a method that will return the name of the class in a format that is compatible with the above use. So for example, if I write the method in a class called Rushee, then it should be able to return a 'rushee' in a way where rushee.getModelName() will work.
Any ideas would be incredibly helpful. Thank you!
To get the name of the class you can use this code