def shift distance
      distance.is_a?(Integer) && distance < 0 and
        raise IndexError, "Distance #{distance} cannot be negative"

      _shift(distance)
    end
def shift distance
      distance.is_a?(Integer) && distance < 0 and
        raise IndexError, "Distance #{distance} cannot be negative"

      _shift(distance)
    end
Shift all dates in the index by a positive number in the future. The dates
 are shifted by the same amount as that specified in the offset.

 @param [Integer, Daru::DateOffset, Daru::Offsets::*] distance Distance by
   which each date should be shifted. Passing an offset object to #shift
   will offset each data point by the offset value. Passing a positive
   integer will offset each data point by the same offset that it was
   created with.
 @return [DateTimeIndex] Returns a new, shifted DateTimeIndex object.
 @example Using the shift method
   index = Daru::DateTimeIndex.date_range(
     :start => '2012', :periods => 10, :freq => 'YEAR')

   # Passing a offset to shift
   index.shift(Daru::Offsets::Hour.new(3))
   #=>#<DateTimeIndex:84038960 offset=nil periods=10 data=[2012-01-01T03:00:00+00:00...2021-01-01T03:00:00+00:00]>

   # Pass an integer to shift
   index.shift(4)
   #=>#<DateTimeIndex:83979630 offset=YEAR periods=10 data=[2016-01-01T00:00:00+00:00...2025-01-01T00:00:00+00:00]>