Class: Gem::Resolv::DNS::SvcParam::IPv6Hint

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

Overview

“ipv6hint” SvcParam – IPv6 address hints

Constant Summary collapse

KeyName =
:ipv6hint
KeyNumber =
6

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(addresses) ⇒ IPv6Hint

Initialize “ipv6hint” ScvParam.



2028
2029
2030
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2028

def initialize(addresses)
  @addresses = addresses.map {|address| IPv6.create(address) }
end

Instance Attribute Details

#addressesObject (readonly)

Set of IPv6 addresses.



2023
2024
2025
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2023

def addresses
  @addresses
end

Class Method Details

.decode(msg) ⇒ Object

:nodoc:



2038
2039
2040
2041
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2038

def self.decode(msg) # :nodoc:
  addresses = msg.get_list { IPv6.new(msg.get_bytes(16)) }
  return self.new(addresses)
end

Instance Method Details

#encode(msg) ⇒ Object

:nodoc:



2032
2033
2034
2035
2036
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2032

def encode(msg) # :nodoc:
  @addresses.each do |address|
    msg.put_bytes(address.address)
  end
end