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

Inherits:
SvcParam
  • Object
show all
Defined in:
lib/resolv.rb

Overview

"port" SvcParam -- Port for alternative endpoint

Constant Summary collapse

KeyName =
:port
KeyNumber =
3

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(port) ⇒ Port

Initialize "port" ScvParam.



2073
2074
2075
# File 'lib/resolv.rb', line 2073

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

Instance Attribute Details

#portObject (readonly)

Port number.



2068
2069
2070
# File 'lib/resolv.rb', line 2068

def port
  @port
end

Class Method Details

.decode(msg) ⇒ Object

:nodoc:



2081
2082
2083
2084
# File 'lib/resolv.rb', line 2081

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

Instance Method Details

#encode(msg) ⇒ Object

:nodoc:



2077
2078
2079
# File 'lib/resolv.rb', line 2077

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