title: Test whether a Ruby class is a subclass of another class
body: <p>I would like to test whether a class inherits from another class, but there doesn't seem to exist a method for that.</p>
  
  <pre><code>class A
  end
  
  class B &lt; A
  end
  
  B.is_a? A 
  =&gt; false
  
  B.superclass == A
  =&gt; true
  </code></pre>
  
  <p>A trivial implementation of what I want would be:</p>
  
  <pre><code>class Class
    def is_subclass_of?(clazz)
      return true if superclass == clazz
      return false if self == Object
      superclass.is_subclass_of?(clazz)
    end
  end
  </code></pre>
  
  <p>but I would expect this to exist already.</p>