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.



2264
2265
2266
# File 'lib/resolv.rb', line 2264

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

Instance Attribute Details

#template ⇒ Object (readonly)

URI template for DoH queries.



2259
2260
2261
# File 'lib/resolv.rb', line 2259

def template
  @template
end

Class Method Details

.decode(msg) ⇒ Object

:nodoc:



2272
2273
2274
2275
# File 'lib/resolv.rb', line 2272

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:



2268
2269
2270
# File 'lib/resolv.rb', line 2268

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