Sha256: 7eb67437c1cea59c780ab8ee454bb58e2c6cccb4d231564ad6725d04d745757e
Contents?: true
Size: 686 Bytes
Versions: 16
Compression:
Stored size: 686 Bytes
Contents
module RecordStore class Record::MX < Record attr_accessor :exchange, :preference validates :preference, numericality: { only_integer: true, greater_than_or_equal_to: 0 }, presence: true validates :exchange, presence: true, format: { with: Record::FQDN_REGEX, message: 'is not a fully qualified domain name' } def initialize(record) super @exchange = Record.ensure_ends_with_dot(record.fetch(:exchange)) @preference = record.fetch(:preference) end def rdata { preference: preference, exchange: exchange } end def to_s "[MXRecord] #{fqdn} #{ttl} IN MX #{preference} #{exchange}" end end end
Version data entries
16 entries across 16 versions & 1 rubygems