title: How to implement an abstract class in Ruby
body: <p>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:</p>
  <pre><code>class A
    def self.new
      raise 'Doh! You are trying to write Java in Ruby!'
    end
  end
  
  class B &lt; A
    ...
    ...
  end
  </code></pre>
  <p>But, when I try to instantiate B, it is internally going to call <code>A.new</code> which is going to raise the exception.</p>
  <p>Also, modules cannot be instantiated, but they cannot be inherited too. Making the new method private will also not work.</p>
  <p>Does anyone have any pointers?</p>