I have a class that inherits from Hash. When this class itself gets inherited from, I want to know the class name of the inheriting class from within the initialize method. When I call self I get {}, which doesn’t know of the name method.
class Foo < Hash
def initialize
# Here i want to know that the class is Foo
end
end
How do I get the class name?
It’s very simple:
self.class.name