def +(extension)
      parameters = extension.split(PARAMETER_SEPARATOR)
      # remove useless initial '; '
      parameters.shift if parameters.first && parameters.first.empty?

      raise ArgumentError, "Must pass a type identifier suffix and/or parameters" if parameters.empty?

      suffix = parameters.shift unless parameters.first.include?('=')
      # remove redundant '+'
      suffix = suffix[1..-1] if suffix && suffix[0] == '+'

      parameters = parameters.each_with_object({}) do |e, h|
        k, v = e.split('=', 2)
        v = v[1...-1] if v =~ /^".*"$/
        h[k] = v
        h
      end
      parameters = Parameters.load(parameters)

      obj = self.class.new
      obj.type = self.type
      obj.subtype = self.subtype
      obj.suffix = suffix || self.suffix || ''
      obj.parameters = self.parameters.merge(parameters)

      obj
    end
def +(extension)
      parameters = extension.split(PARAMETER_SEPARATOR)
      # remove useless initial '; '
      parameters.shift if parameters.first && parameters.first.empty?

      raise ArgumentError, "Must pass a type identifier suffix and/or parameters" if parameters.empty?

      suffix = parameters.shift unless parameters.first.include?('=')
      # remove redundant '+'
      suffix = suffix[1..-1] if suffix && suffix[0] == '+'

      parameters = parameters.each_with_object({}) do |e, h|
        k, v = e.split('=', 2)
        v = v[1...-1] if v =~ /^".*"$/
        h[k] = v
        h
      end
      parameters = Parameters.load(parameters)

      obj = self.class.new
      obj.type = self.type
      obj.subtype = self.subtype
      obj.suffix = suffix || self.suffix || ''
      obj.parameters = self.parameters.merge(parameters)

      obj
    end
Extend this type identifier by adding a suffix or parameter(s); return a new type identifier.

 @param [String] extension an optional suffix, followed by an optional semicolon-separated list of name="value" pairs
 @return [MediaTypeIdentifier]

 @raise [ArgumentError] when an invalid string is passed (e.g. containing neither parameters nor a suffix)

 @example Indicate JSON structured syntax
     MediaTypeIdentifier.new('application/vnd.widget') + 'json' # => 'application/vnd.widget+json'

 @example Indicate UTF8 encoding
     MediaTypeIdentifier.new('application/vnd.widget') + 'charset=UTF8' # => 'application/vnd.widget; charset="UTF8"'