Ruby source code to do the sum of squares operation