From: "Padma J." Date: 2012-09-19T13:29:00+09:00 Subject: Re: how to sum element of array @Matthew: that was funny :) And I agree, should have used more descriptive variable names and 'i' isn't a good choice as it's mostly used for indices. array.inject(0) { |sum, element| sum + element } -- Posted via http://www.ruby-forum.com/.