def matches(media_type)
      type, subtype, params = parse_media_type(media_type)
      values.select {|v|
        if v == media_type || v == '*/*'
          true
        else
          t, s, p = parse_media_type(v)
          t == type && (s == '*' || s == subtype) && (p == '' || params_match?(params, p))
        end
      }.sort_by {|v|
        # Most specific gets precedence.
        v.length
      }.reverse
    end
def matches(media_type)
      type, subtype, params = parse_media_type(media_type)
      values.select {|v|
        if v == media_type || v == '*/*'
          true
        else
          t, s, p = parse_media_type(v)
          t == type && (s == '*' || s == subtype) && (p == '' || params_match?(params, p))
        end
      }.sort_by {|v|
        # Most specific gets precedence.
        v.length
      }.reverse
    end
Returns an array of media types from this header that match the given
 +media_type+, ordered by precedence.