title: The ruby def << syntax for defining methods
body: <p>Im trying to work my way through the Savon gem's source code and I found this line..</p>
  
  <pre><code>def initialize
    @documents = []
  end
  
  def &lt;&lt;(document)
    @documents &lt;&lt; document
  end
  </code></pre>
  
  <p>I was curious as to what the <code>def &lt;&lt;</code> method does. And why he might have elected to use that syntax over something (maybe) more conventional.</p>
  
  <p>the source code can be found at:
  <a href="https://github.com/savonrb/savon/blob/master/lib/savon/wsdl/document_collection.rb" rel="noreferrer">https://github.com/savonrb/savon/blob/master/lib/savon/wsdl/document_collection.rb</a></p>