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

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

Overview

“port” SvcParam – Port for alternative endpoint

Constant Summary collapse

KeyName =
:port
KeyNumber =
3

Constants inherited from Resolv::DNS::SvcParam

ClassHash

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resolv::DNS::SvcParam

key_name, key_number

Constructor Details

#initialize(port) ⇒ Port

Initialize “port” ScvParam.



2000
2001
2002
# File 'lib/resolv.rb', line 2000

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

Instance Attribute Details

#portObject (readonly)

Port number.



1995
1996
1997
# File 'lib/resolv.rb', line 1995

def port
  @port
end

Class Method Details

.decode(msg) ⇒ Object

:nodoc:



2008
2009
2010
2011
# File 'lib/resolv.rb', line 2008

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

Instance Method Details

#encode(msg) ⇒ Object

:nodoc:



2004
2005
2006
# File 'lib/resolv.rb', line 2004

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