Class: Resolv::DNS::Resource::MX
- Inherits:
-
Resolv::DNS::Resource
- Object
- Query
- Resolv::DNS::Resource
- Resolv::DNS::Resource::MX
- Defined in:
- lib/net/dns/resolv.rb
Constant Summary collapse
- TypeValue =
15
Constants inherited from Resolv::DNS::Resource
ClassHash, ClassInsensitiveTypes, ClassValue
Instance Attribute Summary collapse
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
-
#preference ⇒ Object
readonly
Returns the value of attribute preference.
Class Method Summary collapse
-
.decode_rdata(msg) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#encode_rdata(msg) ⇒ Object
:nodoc:.
-
#initialize(preference, exchange) ⇒ MX
constructor
A new instance of MX.
Methods inherited from Resolv::DNS::Resource
Constructor Details
#initialize(preference, exchange) ⇒ MX
Returns a new instance of MX.
1633 1634 1635 1636 |
# File 'lib/net/dns/resolv.rb', line 1633 def initialize(preference, exchange) @preference = preference @exchange = exchange end |
Instance Attribute Details
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
1637 1638 1639 |
# File 'lib/net/dns/resolv.rb', line 1637 def exchange @exchange end |
#preference ⇒ Object (readonly)
Returns the value of attribute preference.
1637 1638 1639 |
# File 'lib/net/dns/resolv.rb', line 1637 def preference @preference end |
Class Method Details
.decode_rdata(msg) ⇒ Object
:nodoc:
1644 1645 1646 1647 1648 |
# File 'lib/net/dns/resolv.rb', line 1644 def self.decode_rdata(msg) # :nodoc: preference, = msg.get_unpack('n') exchange = msg.get_name return self.new(preference, exchange) end |
Instance Method Details
#encode_rdata(msg) ⇒ Object
:nodoc:
1639 1640 1641 1642 |
# File 'lib/net/dns/resolv.rb', line 1639 def encode_rdata(msg) # :nodoc: msg.put_pack('n', @preference) msg.put_name(@exchange) end |