Class: Resolv::DNS::Resource::IN::WKS
- Inherits:
-
Resolv::DNS::Resource
- Object
- Query
- Resolv::DNS::Resource
- Resolv::DNS::Resource::IN::WKS
- Defined in:
- lib/net/dns/resolv.rb
Constant Summary
Constants inherited from Resolv::DNS::Resource
ClassHash, ClassInsensitiveTypes, ClassValue
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#bitmap ⇒ Object
readonly
Returns the value of attribute bitmap.
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
Class Method Summary collapse
-
.decode_rdata(msg) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#encode_rdata(msg) ⇒ Object
:nodoc:.
-
#initialize(address, protocol, bitmap) ⇒ WKS
constructor
A new instance of WKS.
Methods inherited from Resolv::DNS::Resource
Constructor Details
#initialize(address, protocol, bitmap) ⇒ WKS
Returns a new instance of WKS.
1735 1736 1737 1738 1739 |
# File 'lib/net/dns/resolv.rb', line 1735 def initialize(address, protocol, bitmap) @address = IPv4.create(address) @protocol = protocol @bitmap = bitmap end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
1740 1741 1742 |
# File 'lib/net/dns/resolv.rb', line 1740 def address @address end |
#bitmap ⇒ Object (readonly)
Returns the value of attribute bitmap.
1740 1741 1742 |
# File 'lib/net/dns/resolv.rb', line 1740 def bitmap @bitmap end |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
1740 1741 1742 |
# File 'lib/net/dns/resolv.rb', line 1740 def protocol @protocol end |
Class Method Details
.decode_rdata(msg) ⇒ Object
:nodoc:
1748 1749 1750 1751 1752 1753 |
# File 'lib/net/dns/resolv.rb', line 1748 def self.decode_rdata(msg) # :nodoc: address = IPv4.new(msg.get_bytes(4)) protocol, = msg.get_unpack("n") bitmap = msg.get_bytes return self.new(address, protocol, bitmap) end |
Instance Method Details
#encode_rdata(msg) ⇒ Object
:nodoc:
1742 1743 1744 1745 1746 |
# File 'lib/net/dns/resolv.rb', line 1742 def encode_rdata(msg) # :nodoc: msg.put_bytes(@address.address) msg.put_pack("n", @protocol) msg.put_bytes(@bitmap) end |