Class: Gem::Resolv::DNS::SvcParam::Port

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

Overview

“port” SvcParam – Port for alternative endpoint

Constant Summary collapse

KeyName =
:port
KeyNumber =
3

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(port) ⇒ Port

Initialize “port” ScvParam.



1981
1982
1983
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1981

def initialize(port)
  @port = port.to_int
end

Instance Attribute Details

#portObject (readonly)

Port number.



1976
1977
1978
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1976

def port
  @port
end

Class Method Details

.decode(msg) ⇒ Object

:nodoc:



1989
1990
1991
1992
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1989

def self.decode(msg) # :nodoc:
  port, = msg.get_unpack('n')
  return self.new(port)
end

Instance Method Details

#encode(msg) ⇒ Object

:nodoc:



1985
1986
1987
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1985

def encode(msg) # :nodoc:
  msg.put_pack('n', @port)
end