Class: Resolv::DNS::Resource::MX
- Inherits:
-
Resolv::DNS::Resource
- Object
- Query
- Resolv::DNS::Resource
- Resolv::DNS::Resource::MX
- Defined in:
- lib/resolv.rb
Overview
Mail Exchanger resource.
Constant Summary collapse
- TypeValue =
:nodoc:
15
Constants inherited from Resolv::DNS::Resource
ClassHash, ClassInsensitiveTypes, ClassValue
Instance Attribute Summary collapse
-
#exchange ⇒ Object
readonly
The host of this MX.
-
#preference ⇒ Object
readonly
The preference for this MX.
Attributes inherited from Resolv::DNS::Resource
Class Method Summary collapse
-
.decode_rdata(msg) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#encode_rdata(msg) ⇒ Object
:nodoc:.
-
#initialize(preference, exchange) ⇒ MX
constructor
Creates a new MX record with
preference
, accepting mail atexchange
.
Methods inherited from Resolv::DNS::Resource
Constructor Details
#initialize(preference, exchange) ⇒ MX
Creates a new MX record with preference
, accepting mail at exchange
.
1792 1793 1794 1795 |
# File 'lib/resolv.rb', line 1792 def initialize(preference, exchange) @preference = preference @exchange = exchange end |
Instance Attribute Details
#exchange ⇒ Object (readonly)
The host of this MX.
1805 1806 1807 |
# File 'lib/resolv.rb', line 1805 def exchange @exchange end |
#preference ⇒ Object (readonly)
The preference for this MX.
1800 1801 1802 |
# File 'lib/resolv.rb', line 1800 def preference @preference end |
Class Method Details
.decode_rdata(msg) ⇒ Object
:nodoc:
1812 1813 1814 1815 1816 |
# File 'lib/resolv.rb', line 1812 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:
1807 1808 1809 1810 |
# File 'lib/resolv.rb', line 1807 def encode_rdata(msg) # :nodoc: msg.put_pack('n', @preference) msg.put_name(@exchange) end |