Class: RedZone::MailExchange

Inherits:
Object
  • Object
show all
Defined in:
lib/redzone/mail_exchange.rb

Overview

A mail server record

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, machine, priority) ⇒ MailExchange

Constructs a new MailExchange entry

Parameters:

  • name (String)

    Server name / alias

  • machine (Machine)

    Target machine

  • priority (Integer)

    MX priority setting



17
18
19
20
21
# File 'lib/redzone/mail_exchange.rb', line 17

def initialize(name,machine,priority) 
  @name     = name
  @machine  = machine.alias(@name)
  @priority = priority
end

Instance Attribute Details

#machineObject (readonly)

Get the target machine hosting the mail exchange



8
9
10
# File 'lib/redzone/mail_exchange.rb', line 8

def machine
  @machine
end

#nameObject (readonly)

MX Server name / alias



5
6
7
# File 'lib/redzone/mail_exchange.rb', line 5

def name
  @name
end

#priorityObject (readonly)

MX Priority



11
12
13
# File 'lib/redzone/mail_exchange.rb', line 11

def priority
  @priority
end

Instance Method Details

#recordsArray<Record>

Get the list of MX records

Returns:



24
25
26
# File 'lib/redzone/mail_exchange.rb', line 24

def records
  [Record.new(:name => "@", :type => "MX", :data => "#{@priority} #{@name}")]
end