title: Class Method to 'Know' Class Name in Ruby?
body: <p>I want an inherited ruby class to 'know' its class name via a class method. This is best illustrated by a contrived example:</p>
  
  <pre><code>class Parent
    def self.whoami
      ??
    end
  end
  
  class Child &lt; Parent
    #No code should be needed.
  end
  </code></pre>
  
  <p>So I should be able to call:</p>
  
  <pre><code>Parent.whomai
  </code></pre>
  
  <p>and expect a return of "Parent" I should then be able to call:</p>
  
  <pre><code>Child.whoami
  </code></pre>
  
  <p>and expect a return of "Child" I have a feeling that in conventional languages this might not be possible. But Ruby's metaprogramming model has amazed me before. Any thoughts? Thanks in advance.</p>