def normalize(method: :standard)
      normalized_units = NORMALIZATION_METHODS.fetch(method).reverse_each

      initial = [0.seconds, self]
      result = normalized_units.reduce(initial) do |result, (unit, normal)|
        normalized, remainder = result

        seconds_per_unit = normal.fetch(:seconds)
        unit_part = remainder.send(:to_unit_part, unit)

        normalized += (unit_part * seconds_per_unit).seconds
        remainder -= Duration.new(unit => unit_part)
        [normalized, remainder]
      end

      normalized, remainder = result
      normalized + remainder
    end
def normalize(method: :standard)
      normalized_units = NORMALIZATION_METHODS.fetch(method).reverse_each

      initial = [0.seconds, self]
      result = normalized_units.reduce(initial) do |result, (unit, normal)|
        normalized, remainder = result

        seconds_per_unit = normal.fetch(:seconds)
        unit_part = remainder.send(:to_unit_part, unit)

        normalized += (unit_part * seconds_per_unit).seconds
        remainder -= Duration.new(unit => unit_part)
        [normalized, remainder]
      end

      normalized, remainder = result
      normalized + remainder
    end
Return a new duration that approximates the given input duration, where
 every "month-based" unit of the input is converted to seconds. Because
 durations are composed of two distinct units ("seconds" and "months"),
 two durations need to be normalized before being compared. By default,
 most methods on {Duration} perform normalization or denormalization, so
 clients will not usually need to call this method directly.

 @param [Symbol] method The normalization method to be used. For a list
   of normalization methods, see {NORMALIZATION_METHODS}.

 @return [Duration] The duration after being normalized.

 @example
   1.month.normalize == 30.days
   1.month.normalize(method: :standard) == 30.days
   1.month.normalize(method: :maximum) == 31.days
   1.month.normalize(method: :minimum) == 28.days

   1.year.normalize == 365.days
   1.year.normalize(method: :standard) == 365.days
   1.year.normalize(method: :minimum) == 365.days
   1.year.normalize(method: :maximum) == 366.days

 @see #denormalize