123456789_123456789_123456789_123456789_123456789_

Class: Resolv::DNS::Resource::MX

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Resolv::DNS::Resource
Defined in: lib/resolv.rb

Overview

Mail Exchanger resource.

Constant Summary

::Resolv::DNS::Resource - Inherited

ClassHash, ClassInsensitiveTypes, ClassValue

Class Method Summary

::Resolv::DNS::Resource - Inherited

::Resolv::DNS::Query - Inherited

Instance Attribute Summary

::Resolv::DNS::Resource - Inherited

#ttl

Remaining Time To Live for this ::Resolv::DNS::Resource.

Instance Method Summary

Constructor Details

.new(preference, exchange) ⇒ MX

Creates a new MX record with #preference, accepting mail at #exchange.

[ GitHub ]

  
# File 'lib/resolv.rb', line 1981

def initialize(preference, exchange)
  @preference = preference
  @exchange = exchange
end

Class Method Details

.decode_rdata(msg)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/resolv.rb', line 2001

def self.decode_rdata(msg) # :nodoc:
  preference, = msg.get_unpack('n')
  exchange = msg.get_name
  return self.new(preference, exchange)
end

Instance Attribute Details

#exchange (readonly)

The host of this MX.

[ GitHub ]

  
# File 'lib/resolv.rb', line 1994

attr_reader :exchange

#preference (readonly)

The preference for this MX.

[ GitHub ]

  
# File 'lib/resolv.rb', line 1989

attr_reader :preference

Instance Method Details

#encode_rdata(msg)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/resolv.rb', line 1996

def encode_rdata(msg) # :nodoc:
  msg.put_pack('n', @preference)
  msg.put_name(@exchange)
end