Tuesday, May 1, 2012

Referring to class from class method and instance method

Instead of directly writing ClassName for calling methods, this can be done in a different way by writing self.class

Below is a small example: 

Output will be:

Class Name is SomeClass

Class Name is SomeClass