title: Overriding instance variable array's operators in Ruby
body: <p>Sorry for the poor title, I don't really know what to call this.</p>
  
  <p>I have something like this in Ruby:</p>
  
  <pre><code>class Test
    def initialize
      @my_array = []
    end
    attr_accessor :my_array
  end
  test = Test.new
  test.my_array &lt;&lt; "Hello, World!"
  </code></pre>
  
  <p>For the <code>@my_array</code> instance variable, I want to override the <code>&lt;&lt;</code> operator so that I can first process whatever is being inserted to it. I've tried <code>@my_array.&lt;&lt;(value)</code> as a method in the class, but it didn't work.</p>