# Resolv::DNS::Resource::MX (Class)

In: | resolv.rb
Parent: | Resource

## Methods

decode_rdata encode_rdata new

## Constants

TypeValue | = | 15

## Attributes

exchange | [R] |
preference | [R] |

## Public Class methods

new(preference, exchange)

[Source]

    # File resolv.rb, line 1423
            def initialize(preference, exchange)
              @preference = preference
              @exchange = exchange
            end

decode_rdata(msg)

[Source]

    # File resolv.rb, line 1434
            def self.decode_rdata(msg)
              preference, = msg.get_unpack('n')
              exchange = msg.get_name
              return self.new(preference, exchange)
            end

## Public Instance methods

encode_rdata(msg)

[Source]

    # File resolv.rb, line 1429
            def encode_rdata(msg)
              msg.put_pack('n', @preference)
              msg.put_name(@exchange)
            end

[Validate]