Class: Resolv::DNS::SvcParam::Mandatory
- Inherits:
-
Resolv::DNS::SvcParam
- Object
- Resolv::DNS::SvcParam
- Resolv::DNS::SvcParam::Mandatory
- Defined in:
- lib/resolv.rb
Overview
“mandatory” SvcParam – Mandatory keys in service binding RR
Constant Summary collapse
- KeyName =
:mandatory
- KeyNumber =
0
Constants inherited from 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 Resolv::DNS::SvcParam
Constructor Details
#initialize(keys) ⇒ Mandatory
Initialize “mandatory” ScvParam.
1922 1923 1924 |
# File 'lib/resolv.rb', line 1922 def initialize(keys) @keys = keys.map(&:to_int) end |
Instance Attribute Details
#keys ⇒ Object (readonly)
Mandatory keys.
1917 1918 1919 |
# File 'lib/resolv.rb', line 1917 def keys @keys end |
Class Method Details
.decode(msg) ⇒ Object
:nodoc:
1932 1933 1934 1935 |
# File 'lib/resolv.rb', line 1932 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:
1926 1927 1928 1929 1930 |
# File 'lib/resolv.rb', line 1926 def encode(msg) # :nodoc: @keys.sort.each do |key| msg.put_pack('n', key) end end |