Class: Gem::Resolv::DNS::SvcParam::DoHPath

Inherits:
Gem::Resolv::DNS::SvcParam show all
Defined in:
lib/rubygems/vendor/resolv/lib/resolv.rb

Overview

“dohpath” SvcParam – DNS over HTTPS path template [RFC9461]

Constant Summary collapse

KeyName =
:dohpath
KeyNumber =
7

Constants inherited from Gem::Resolv::DNS::SvcParam

ClassHash

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Gem::Resolv::DNS::SvcParam

key_name, key_number

Constructor Details

#initialize(template) ⇒ DoHPath

Initialize “dohpath” ScvParam.



2067
2068
2069
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2067

def initialize(template)
  @template = template.encode('utf-8')
end

Instance Attribute Details

#templateObject (readonly)

URI template for DoH queries.



2062
2063
2064
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2062

def template
  @template
end

Class Method Details

.decode(msg) ⇒ Object

:nodoc:



2075
2076
2077
2078
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2075

def self.decode(msg) # :nodoc:
  template = msg.get_bytes.force_encoding('utf-8')
  return self.new(template)
end

Instance Method Details

#encode(msg) ⇒ Object

:nodoc:



2071
2072
2073
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2071

def encode(msg) # :nodoc:
  msg.put_bytes(@template)
end