Trivial using a for loop or each_with_index, just wondering if there was a better way of doing it using Ruby syntax.
I need to create a new array that is the derivative of the source array, eg:
for(int i = 1; i < oldArray.length; i++)
{
newArray[i] = oldArray[i] - oldArray[i-1]
}