Sha256: 20c794c77e3a4ca4c50a4a93d1751595e26e0a7fd638f3e1935720f028372138
Contents?: true
Size: 1.02 KB
Versions: 45
Compression:
Stored size: 1.02 KB
Contents
module RecordStore class Record::SRV < Record attr_accessor :priority, :port, :weight, :target validates :priority, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0, } validates :port, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0, } validates :weight, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0, } validates :target, presence: true, format: { with: Record::CNAME_REGEX, message: 'is not a fully qualified domain name', } def initialize(record) super @priority = record.fetch(:priority) @weight = record.fetch(:weight) @port = record.fetch(:port) @target = record.fetch(:target) end def rdata { priority: priority, port: port, weight: weight, target: target } end def rdata_txt "#{priority} #{weight} #{port} #{target}" end end end
Version data entries
45 entries across 45 versions & 1 rubygems