Ruby recursive array summation