Sha256: bc11cc7b69fada33cc6f0c32dc85ce6c5a595738868717d3b2640f2b716a12a2

Contents?: true

Size: 962 Bytes

Versions: 16

Compression:

Stored size: 962 Bytes

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 to_s
      "[SRVRecord] #{fqdn} #{ttl} IN SRV #{priority} #{weight} #{port} #{target}"
    end

    def rdata
      { priority: priority, port: port, weight: weight, target: target }
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
record_store-4.0.7 lib/record_store/record/srv.rb
record_store-4.0.6 lib/record_store/record/srv.rb
record_store-4.0.5 lib/record_store/record/srv.rb
record_store-4.0.4 lib/record_store/record/srv.rb
record_store-4.0.3 lib/record_store/record/srv.rb
record_store-4.0.2 lib/record_store/record/srv.rb
record_store-4.0.1 lib/record_store/record/srv.rb
record_store-4.0.0 lib/record_store/record/srv.rb
record_store-3.1.4 lib/record_store/record/srv.rb
record_store-3.1.3 lib/record_store/record/srv.rb
record_store-3.1.1 lib/record_store/record/srv.rb
record_store-3.1.0 lib/record_store/record/srv.rb
record_store-3.0.0 lib/record_store/record/srv.rb
record_store-2.1.0 lib/record_store/record/srv.rb
record_store-2.0.0 lib/record_store/record/srv.rb
record_store-1.0.0 lib/record_store/record/srv.rb