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

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

        seconds_per_unit = normal.fetch(:seconds)
        remainder_seconds = remainder.get(:seconds)

        num_unit = self.class.div(remainder_seconds, seconds_per_unit)
        num_seconds_denormalized = num_unit * seconds_per_unit

        denormalized += Duration.new(unit => num_unit)
        remainder -= num_seconds_denormalized.seconds

        [denormalized, remainder]
      end

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

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

        seconds_per_unit = normal.fetch(:seconds)
        remainder_seconds = remainder.get(:seconds)

        num_unit = self.class.div(remainder_seconds, seconds_per_unit)
        num_seconds_denormalized = num_unit * seconds_per_unit

        denormalized += Duration.new(unit => num_unit)
        remainder -= num_seconds_denormalized.seconds

        [denormalized, remainder]
      end

      denormalized, remainder = result
      denormalized + remainder
    end
Return a new duration that inverts an approximation made by {#normalize}.
 Denormalization results in a {Duration} where "second-based" units are
 converted back to "month-based" units. Note that, due to the lossy nature
 {#normalize}, the result of calling {#normalize} then {#denormalize} may
 result in a {Duration} that is _not_ equal to the input.

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

 @return [Duration] The duration after being denormalized.

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

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