I know there is no concept of an abstract class in Ruby. But if it needs to be implemented, how do I go about it? I tried something like this:
class A
def self.new
raise 'Doh! You are trying to write Java in Ruby!'
end
end
class B < A
...
...
end
But, when I try to instantiate B, it is internally going to call A.new
which is going to raise the exception.
Also, modules cannot be instantiated, but they cannot be inherited too. Making the new method private will also not work.
Does anyone have any pointers?