Class: Gem::Resolv::DNS::SvcParam::Mandatory
- Inherits:
-
Gem::Resolv::DNS::SvcParam
- Object
- Gem::Resolv::DNS::SvcParam
- Gem::Resolv::DNS::SvcParam::Mandatory
- Defined in:
- lib/rubygems/vendor/resolv/lib/resolv.rb
Overview
“mandatory” SvcParam – Mandatory keys in service binding RR
Constant Summary collapse
- KeyName =
:mandatory
- KeyNumber =
0
Constants inherited from Gem::Resolv::DNS::SvcParam
Instance Attribute Summary collapse
-
#keys ⇒ Object
readonly
Mandatory keys.
Class Method Summary collapse
-
.decode(msg) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#encode(msg) ⇒ Object
:nodoc:.
-
#initialize(keys) ⇒ Mandatory
constructor
Initialize “mandatory” ScvParam.
Methods inherited from Gem::Resolv::DNS::SvcParam
Constructor Details
#initialize(keys) ⇒ Mandatory
Initialize “mandatory” ScvParam.
1888 1889 1890 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1888 def initialize(keys) @keys = keys.map(&:to_int) end |
Instance Attribute Details
#keys ⇒ Object (readonly)
Mandatory keys.
1883 1884 1885 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1883 def keys @keys end |
Class Method Details
.decode(msg) ⇒ Object
:nodoc:
1898 1899 1900 1901 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1898 def self.decode(msg) # :nodoc: keys = msg.get_list { msg.get_unpack('n')[0] } return self.new(keys) end |
Instance Method Details
#encode(msg) ⇒ Object
:nodoc:
1892 1893 1894 1895 1896 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 1892 def encode(msg) # :nodoc: @keys.sort.each do |key| msg.put_pack('n', key) end end |