Class: Gem::Resolv::DNS::Resource::MX
- Inherits:
-
Gem::Resolv::DNS::Resource
- Object
- Query
- Gem::Resolv::DNS::Resource
- Gem::Resolv::DNS::Resource::MX
- Defined in:
- lib/rubygems/vendor/resolv/lib/resolv.rb
Overview
Mail Exchanger resource.
Constant Summary collapse
- TypeValue =
:nodoc:
15
Constants inherited from Gem::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 Gem::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 Gem::Resolv::DNS::Resource
Constructor Details
#initialize(preference, exchange) ⇒ MX
Creates a new MX record with preference
, accepting mail at exchange
.
2397 2398 2399 2400 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2397 def initialize(preference, exchange) @preference = preference @exchange = exchange end |
Instance Attribute Details
#exchange ⇒ Object (readonly)
The host of this MX.
2410 2411 2412 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2410 def exchange @exchange end |
#preference ⇒ Object (readonly)
The preference for this MX.
2405 2406 2407 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2405 def preference @preference end |
Class Method Details
.decode_rdata(msg) ⇒ Object
:nodoc:
2417 2418 2419 2420 2421 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2417 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:
2412 2413 2414 2415 |
# File 'lib/rubygems/vendor/resolv/lib/resolv.rb', line 2412 def encode_rdata(msg) # :nodoc: msg.put_pack('n', @preference) msg.put_name(@exchange) end |