Ruby-style sum method for Array