Sha256: b501c9f28e0ea9fd50798bedbd81fcdc661f256ad07350873697db0002c07251

Contents?: true

Size: 555 Bytes

Versions: 44

Compression:

Stored size: 555 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?
      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

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
record_store-8.0.3 lib/record_store/record/aaaa.rb
record_store-8.0.2 lib/record_store/record/aaaa.rb
record_store-8.0.1 lib/record_store/record/aaaa.rb
record_store-8.0.0 lib/record_store/record/aaaa.rb
record_store-7.1.1 lib/record_store/record/aaaa.rb
record_store-7.1.0 lib/record_store/record/aaaa.rb
record_store-7.0.1 lib/record_store/record/aaaa.rb
record_store-7.0.0 lib/record_store/record/aaaa.rb
record_store-6.7.2 lib/record_store/record/aaaa.rb
record_store-6.7.1 lib/record_store/record/aaaa.rb
record_store-6.7.0 lib/record_store/record/aaaa.rb
record_store-6.6.0 lib/record_store/record/aaaa.rb
record_store-6.5.11 lib/record_store/record/aaaa.rb
record_store-6.5.10 lib/record_store/record/aaaa.rb
record_store-6.5.9 lib/record_store/record/aaaa.rb
record_store-6.5.8 lib/record_store/record/aaaa.rb
record_store-6.5.5 lib/record_store/record/aaaa.rb
record_store-6.5.4 lib/record_store/record/aaaa.rb
record_store-6.5.3 lib/record_store/record/aaaa.rb
record_store-6.5.2 lib/record_store/record/aaaa.rb