def is_unit?(unit)
      if unit
        denominator_units.size == 0 && numerator_units.size == 1 && numerator_units.first == unit
      else
        unitless?
      end
    end
def is_unit?(unit)
      if unit
        denominator_units.size == 0 && numerator_units.size == 1 && numerator_units.first == unit
      else
        unitless?
      end
    end
Checks whether the number has the numerator unit specified.

 @example
   number = Sass::Script::Value::Number.new(10, "px")
   number.is_unit?("px") => true
   number.is_unit?(nil) => false

 @param unit [::String, nil] The unit the number should have or nil if the number
   should be unitless.
 @see Number#unitless? The unitless? method may be more readable.