title: Ruby: Module, Mixins and Blocks confusing?
body: <p>Following is the code I tried to run from the <code>Ruby Programming</code> Book
  <a href="http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html" rel="nofollow">http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html</a></p>
  
  <p>Why doesn't the <code>product</code> method give the right output?
  I ran it with <code>irb test.rb</code>. And I am running <code>Ruby 1.9.3p194</code>. </p>
  
  <pre class="lang-ruby prettyprint-override"><code>module Inject
    def inject(n)
      each do |value|
        n = yield(n, value)
      end
      n
    end
  
    def sum(initial = 0)
      inject(initial) { |n, value| n + value }
    end
  
    def product(initial = 1)
      inject(initial) { |n, value| n * value }
    end
  end
  
  class Array
    include Inject
  end
  
  [1, 2, 3, 4, 5].sum            ## 15
  [1, 2, 3, 4, 5].product        ## [[1], [2], [3], [4], [5]]
  </code></pre>