I have a simple pair of classes that looks like this:
class X
include Singleton
def base_name; self.class.name; end
end
class Y < X
# ...
end
I would like invocations of #basename on Y (and on any other subclass of X) to return “X”, and not the name of the subclass.
What’s the best way to do that?
Try this: