Sha256: b4a9de9e8da793d76e683602e45601a2964afd2486f047adb935b4a3fc697bb9
Contents?: true
Size: 585 Bytes
Versions: 16
Compression:
Stored size: 585 Bytes
Contents
module RecordStore class Record::AAAA < Record attr_accessor :address validates_presence_of :address validate :valid_address? def initialize(record) super @address = record.fetch(:address) end def rdata { address: address } end def rdata_txt address end private def valid_address? begin ip = IPAddr.new(address) errors.add(:address, 'is not an IPv6 address') unless ip.ipv6? rescue IPAddr::InvalidAddressError errors.add(:address, 'is invalid') end end end end
Version data entries
16 entries across 16 versions & 1 rubygems