title: Modifying the default return value of an object belonging to an extended class
body: <p>I am relatively new to the rails syntax. I have a LogString class</p>
  
  <pre><code>class LogString &lt; Array
  </code></pre>
  
  <p>I do the following with it</p>
  
  <pre><code>logs = LogString.new
  logs.push 'this happened'
  logs.push 'that happened'
  </code></pre>
  
  <p>which works fine. i want to be able to just write only</p>
  
  <pre><code>logs
  </code></pre>
  
  <p>to return what would be logs.join( ' | ' )</p>
  
  <p>so i am looking for a syntax something like the method log_string here</p>
  
  <pre><code>class LogString &lt; Array
     def log_string
        self.join( ' | ' )
     end
  end
  </code></pre>
  
  <p>but where log_string is automatically called when i simply write the class instance name: logs</p>
  
  <p>how can i do that?</p>