title: What is the relationship between the metaclass of Base and Derived class in Ruby?
body: <p>In Ruby, we could use <code>super</code> within singleton method to call the corresponding super class's singleton method, like the following code shows.</p>
  
  <pre><code>class Base
    def self.class_method
      puts "Base class method"
    end
  end
  
  class Derived &lt; Base
    def self.class_method
      puts "Derived class method"
      super
    end
  end
  
  Derived.class_method
  # Derived class method
  # Base class method
  </code></pre>
  
  <p>However, I don't seem quite get how that call to <code>super</code> within <code>Derived.class_method</code> could reach <code>Base.class_method</code>. I'd assume that <code>class_method</code> is defined on their metaclass, does that mean their metaclass has parent/child relationship? (I can't quite confirm that by experiments)</p>
  
  <p><em>Update</em>: I'm asking this question because I remembered seeing <em>somewhere</em> there's some kind of relationship bettwen base and derived class' metaclass (but I can't find it any more). In addition to know how actually <code>super</code> works, I'd also like to confirm whether the two metaclasses are totally separate or not.</p>