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

Inherits:
SvcParam
  • Object
show all
Defined in:
lib/resolv.rb

Overview

"dohpath" SvcParam -- DNS over HTTPS path template [RFC9461]

Constant Summary collapse

KeyName =
:dohpath
KeyNumber =
7

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template) ⇒ DoHPath

Initialize "dohpath" ScvParam.



2167
2168
2169
# File 'lib/resolv.rb', line 2167

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

Instance Attribute Details

#templateObject (readonly)

URI template for DoH queries.



2162
2163
2164
# File 'lib/resolv.rb', line 2162

def template
  @template
end

Class Method Details

.decode(msg) ⇒ Object

:nodoc:



2175
2176
2177
2178
# File 'lib/resolv.rb', line 2175

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:



2171
2172
2173
# File 'lib/resolv.rb', line 2171

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