title: What's the __repr__ equivalence in ruby?
body: <p>The <code>__repr__</code> function of python is fancy as it is called when print OBJECT is used automatically.</p>
  
  <p>Is there a ruby equivalence for it? I thought it was to_s, but, I had p OBJECT doesn't seem to call the to_s method. </p>
  
  <h2>Added</h2>
  
  <p>I got something wrong, p OBJECT seems to call to_s method as follows. 
  I got some hints from my the answers to my other question. - <a href="https://stackoverflow.com/questions/2625093/rubys-to-s-method-question-from-axe-book-2nd-edition">Ruby&#39;s to_s method question (from Axe book 2nd edition)</a></p>
  
  <pre><code># Sample code from Programing Ruby, page 24
  class Song
    def to_s
      "Song"
    end
  end
  
  class Songson &lt; Song
    def to_s
      super + "&lt;Songson&gt;"
    end
  end
  
  song = Songson.new()
  p song
  </code></pre>