Sander Land wrote:
> class Array
>   def sum
>     inject(0){|a,b| a+b}
>   end
> end

For a little more speed, try instead:

class Array
  def sum
    inject{ |a,b| a+b }
  end
end