Class: DNS::ResourceRecord::IN::MX
- Defined in:
- lib/faildns/resourcerecord/IN/MX.rb
Overview
–
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| PREFERENCE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ EXCHANGE /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
where:
PREFERENCE A 16 bit integer which specifies the preference given to
this RR among others at the same owner. Lower values
are preferred.
EXCHANGE A <domain-name> which specifies a host willing to act as
a mail exchange for the owner name.
MX records cause type A additional section processing for the host specified by EXCHANGE. The use of MX RRs is explained in detail in [RFC-974]. ++
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
Instance Method Summary collapse
-
#initialize(preference, exchange) ⇒ MX
constructor
A new instance of MX.
- #pack ⇒ Object
- #to_s ⇒ Object
Methods inherited from Data
Constructor Details
#initialize(preference, exchange) ⇒ MX
Returns a new instance of MX.
57 58 59 60 |
# File 'lib/faildns/resourcerecord/IN/MX.rb', line 57 def initialize (preference, exchange) @preference = preference @exchange = exchange end |
Instance Attribute Details
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
55 56 57 |
# File 'lib/faildns/resourcerecord/IN/MX.rb', line 55 def exchange @exchange end |
#preference ⇒ Object (readonly)
Returns the value of attribute preference.
55 56 57 |
# File 'lib/faildns/resourcerecord/IN/MX.rb', line 55 def preference @preference end |
Class Method Details
._parse(string, original) ⇒ Object
51 52 53 |
# File 'lib/faildns/resourcerecord/IN/MX.rb', line 51 def self._parse (string, original) MX.new(string.unpack('n'), DomainName.parse(string[2, 255], original)) end |
Instance Method Details
#pack ⇒ Object
62 63 64 |
# File 'lib/faildns/resourcerecord/IN/MX.rb', line 62 def pack [@preference].pack('n') + @exchange.pack end |
#to_s ⇒ Object
66 67 68 |
# File 'lib/faildns/resourcerecord/IN/MX.rb', line 66 def to_s "#{@preference}) #{@exchange}" end |