Class: Gem::Resolv::DNS::SvcParam::IPv4Hint

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

Overview

“ipv4hint” SvcParam – IPv4 address hints

Constant Summary collapse

KeyName =
:ipv4hint
KeyNumber =
4

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) ⇒ IPv4Hint

Initialize “ipv4hint” ScvParam.



2011
2012
2013
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2011

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

Instance Attribute Details

#addressesObject (readonly)

Set of IPv4 addresses.



2006
2007
2008
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2006

def addresses
  @addresses
end

Class Method Details

.decode(msg) ⇒ Object

:nodoc:



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

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

Instance Method Details

#encode(msg) ⇒ Object

:nodoc:



2015
2016
2017
2018
2019
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2015

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