title: How do you overload the << operator in Ruby?
body: <p>I'm not sure how to accomplish overloading the &lt;&lt; operator for a method. This is how I assumed it would work:  </p>
  
  <pre><code>def roles&lt;&lt;(roles)
    ...  
  end
  </code></pre>
  
  <p>That however, throws errors. Any suggestions?</p>