class SvcbRrPatch::SvcParams::Alpn

Attributes

protocols[R]

Public Class Methods

new(protocols) click to toggle source

@param protocols [Array of String]

# File lib/svcb_rr_patch/svc_params/alpn.rb, line 7
def initialize(protocols)
  @protocols = protocols
end

Public Instance Methods

encode() click to toggle source

@return [String]

# File lib/svcb_rr_patch/svc_params/alpn.rb, line 12
def encode
  @protocols.map { |p| [p.length].pack('C') + p }.join
end