title: How do I get the name of a Ruby class?
body: <p>How can I get the class name from an ActiveRecord object?</p>
  
  <p>I have:</p>
  
  <pre><code>result = User.find(1)
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>result.class
  # =&gt; User(id: integer, name: string ...)
  result.to_s
  # =&gt; #&lt;User:0x3d07cdc&gt;"
  </code></pre>
  
  <p>I need only the class name, in a string (<code>User</code> in this case). Is there a method for that? </p>
  
  <p>I know this is pretty basic, but I searched both Rails' and Ruby's docs, and I couldn't find it.</p>