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

Class | Resolv::DNS::Resource::MX
In: | resolv.rb
Parent: | Resource

### Methods

decode_rdata encode_rdata new

### Constants

TypeValue | = | 15

### Attributes

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

### Public Class methods

decode_rdata(msg)

[Source]

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

new(preference, exchange)

[Source]

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

### Public Instance methods

encode_rdata(msg)

[Source]

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

[Validate]