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

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

Overview

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

Constant Summary collapse

KeyName =
:dohpath
KeyNumber =
7

Constants inherited from Resolv::DNS::SvcParam

ClassHash

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resolv::DNS::SvcParam

key_name, key_number

Constructor Details

#initialize(template) ⇒ DoHPath

Initialize “dohpath” ScvParam.



2060
2061
2062
# File 'lib/resolv.rb', line 2060

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

Instance Attribute Details

#templateObject (readonly)

URI template for DoH queries.



2055
2056
2057
# File 'lib/resolv.rb', line 2055

def template
  @template
end

Class Method Details

.decode(msg) ⇒ Object

:nodoc:



2068
2069
2070
2071
# File 'lib/resolv.rb', line 2068

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:



2064
2065
2066
# File 'lib/resolv.rb', line 2064

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