title: self vs class name for class methods in inheritance
body: <p>In this code:</p>
  
  <pre><code>class Dog
    def self.bark
      print "woof"
    end
  end
  
  class Little_dog &lt; Dog
  end
  
  Little_dog.bark
  </code></pre>
  
  <p>the method is inherited from a generalised class that references <code>self</code>. But the next patch of code:</p>
  
  <pre><code>class Dog
    def Dog.bark
      print "woof"
    end
  end
  
  class Little_dog &lt; Dog
  end
  
  Little_dog.bark
  </code></pre>
  
  <p>also works. I was expecting it to give me an error, but it didn't. </p>
  
  <p>How does <code>self</code> refer to the class method under class inheritance? Why does the <code>little_dog</code> class have a class method <code>bark</code> in the second example when I only defined it as a class method of <code>Dog</code>?</p>