def convert(quantity, unit)
      return quantity if unit == self
      # if there is a converter to the target unit, then call it
      converter = @converters[unit]
      return converter.call(quantity) if converter
      # validate the target unit dimension
      unless @dimension == unit.dimension then
        raise MeasurementError.new("Cannot convert #{unit} dimension #{unit.dimension} to #{self} dimension #{@dimension}")
      end
      # convert via an axis pivot intermediary
      pivot = conversion_pivot(unit)
      pivot.as(self.as(quantity, pivot), unit)
    end
def convert(quantity, unit)
      return quantity if unit == self
      # if there is a converter to the target unit, then call it
      converter = @converters[unit]
      return converter.call(quantity) if converter
      # validate the target unit dimension
      unless @dimension == unit.dimension then
        raise MeasurementError.new("Cannot convert #{unit} dimension #{unit.dimension} to #{self} dimension #{@dimension}")
      end
      # convert via an axis pivot intermediary
      pivot = conversion_pivot(unit)
      pivot.as(self.as(quantity, pivot), unit)
    end
Returns the given quantity converted from this Unit into the given unit.