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.
1900 1901 1902 |
# File 'lib/resolv.rb', line 1900 def initialize(keys) @keys = keys.map(&:to_int) end |
Instance Attribute Details
#keys ⇒ Object (readonly)
Mandatory keys.
1895 1896 1897 |
# File 'lib/resolv.rb', line 1895 def keys @keys end |
Class Method Details
.decode(msg) ⇒ Object
:nodoc:
1910 1911 1912 1913 |
# File 'lib/resolv.rb', line 1910 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:
1904 1905 1906 1907 1908 |
# File 'lib/resolv.rb', line 1904 def encode(msg) # :nodoc: @keys.sort.each do |key| msg.put_pack('n', key) end end |