Sum up array contents with a simple method
With just:
array.inject(:+)
It will take an array and sum it up.
>> [0,2,3,1]
>> [0,2,3,1].inject(:+)
=> 6
With just:
array.inject(:+)
It will take an array and sum it up.
>> [0,2,3,1]
>> [0,2,3,1].inject(:+)
=> 6