Class: Zonesync::Parser::MX

Inherits:
Record
  • Object
show all
Defined in:
lib/zonesync/parser.rb

Instance Attribute Summary collapse

Attributes inherited from Record

#comment, #host, #klass, #ttl

Instance Method Summary collapse

Methods inherited from Record

#type

Constructor Details

#initialize(vars, zonefile_record) ⇒ MX

Returns a new instance of MX.



200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/zonesync/parser.rb', line 200

def initialize(vars, zonefile_record)
  @vars = vars
  if zonefile_record
    self.host = qualify_host(zonefile_record.host.to_s)
    @vars[:last_host] = host
    self.ttl = zonefile_record.ttl.to_i
    self.klass = zonefile_record.klass.to_s
    self.priority = zonefile_record.priority.to_i
    self.domainname = qualify_host(zonefile_record.exchanger.to_s)
    self.comment = zonefile_record.comment&.to_s
  end
end

Instance Attribute Details

#domainnameObject Also known as: exchange, exchanger

Returns the value of attribute domainname.



198
199
200
# File 'lib/zonesync/parser.rb', line 198

def domainname
  @domainname
end

#priorityObject

Returns the value of attribute priority.



198
199
200
# File 'lib/zonesync/parser.rb', line 198

def priority
  @priority
end

Instance Method Details

#rdataObject



213
214
215
# File 'lib/zonesync/parser.rb', line 213

def rdata
  "#{priority} #{domainname}"
end