def to_s
      has_all_ascii_values =
        @content.bytes.reject { |c| (32 < c && c < 126) }.empty?

      could_be_32bit_num = (@content.length == 4)
      could_be_64bit_num = (@content.length == 8)

      could_be_ip = ((@content.length == 6 && @content[0..1] == "\x00\x01") ||
                     (@content.length == 18 && @content[0..1] == "\x00\x02"))

      maybe_grouped = !(has_all_ascii_values ||
                        could_be_64bit_num   ||
                        could_be_32bit_num   ||
                        could_be_ip)

      s = vendor_specific? ? "AVP #{@code}, Vendor-ID #{@vendor_id}, mandatory: #{@mandatory}" :
              "AVP #{@code}, mandatory: #{@mandatory}"
      s += ", content as string: #{@content}" if has_all_ascii_values
      s += ", content as int32: #{uint32}" if could_be_32bit_num
      s += ", content as int64: #{uint64}" if could_be_64bit_num
      s += ", content as ip: #{ip_address}" if could_be_ip
      s += ", grouped AVP, #{grouped_value.collect(&:to_s)}" if maybe_grouped

      s
    end
def to_s
      has_all_ascii_values =
        @content.bytes.reject { |c| (32 < c && c < 126) }.empty?

      could_be_32bit_num = (@content.length == 4)
      could_be_64bit_num = (@content.length == 8)

      could_be_ip = ((@content.length == 6 && @content[0..1] == "\x00\x01") ||
                     (@content.length == 18 && @content[0..1] == "\x00\x02"))

      maybe_grouped = !(has_all_ascii_values ||
                        could_be_64bit_num   ||
                        could_be_32bit_num   ||
                        could_be_ip)

      s = vendor_specific? ? "AVP #{@code}, Vendor-ID #{@vendor_id}, mandatory: #{@mandatory}" :
              "AVP #{@code}, mandatory: #{@mandatory}"
      s += ", content as string: #{@content}" if has_all_ascii_values
      s += ", content as int32: #{uint32}" if could_be_32bit_num
      s += ", content as int64: #{uint64}" if could_be_64bit_num
      s += ", content as ip: #{ip_address}" if could_be_ip
      s += ", grouped AVP, #{grouped_value.collect(&:to_s)}" if maybe_grouped

      s
    end
Guessing the type of an AVP and displaying it sensibly is complex,
 so this is a complex method (but one that has a unity of purpose,
 so can't easily be broken down). Disable several Rubocop
 complexity metrics to reflect this.
 rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
 rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity
 Returns a string representation of this AVP. Makes a best-effort
 attempt to guess the type of the content (even for unknown AVPs)
 and display it sensibly.

 @example
   avp.to_s => "AVP 267, mandatory: true, content as int32: 1"