title: Ruby override initialize method of an array class
body: <p>Basically, I want to have my own array-like class with my own methods. </p>
  
  <p>I would like to initialize it by passing an arguement of the length of an array, and it should instantiate a new array with given length and filled with zeros. So I've written something like this:</p>
  
  <pre><code>class Foo &lt; Array
    def initialize(length)
      Array.new(length, 0)
    end
  end
  </code></pre>
  
  <p>But when I test this out in IRB i get this:</p>
  
  <pre><code>a = Foo.new(5)
  =&gt; [] 
  </code></pre>
  
  <p>I also tried using for-loop to fill this array with zeros n-times, but to no avail.</p>
  
  <p>What am I doing wrong?</p>