123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Gem::Resolv::DNS::SvcParam
Defined in: lib/rubygems/vendor/resolv/lib/resolv.rb

Overview

“port” ::Gem::Resolv::DNS::SvcParamPort for alternative endpoint

Constant Summary

::Gem::Resolv::DNS::SvcParam - Inherited

ClassHash

Class Method Summary

::Gem::Resolv::DNS::SvcParam - Inherited

.key_name

Get the presentation name of the SvcParamKey.

.key_number

Get the registered number of the SvcParamKey.

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(port) ⇒ Port

Initialize “port” ScvParam.

[ GitHub ]

  
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1966

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

Class Method Details

.decode(msg)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1974

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

Instance Attribute Details

#port (readonly)

Port number.

[ GitHub ]

  
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1961

attr_reader :port

Instance Method Details

#encode(msg)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1970

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