class DNS::Zone::RR::TXT

`A` resource record.

RFC 1035

Attributes

text[RW]

Public Instance Methods

dump() click to toggle source
# File lib/dns/zone/rr/txt.rb, line 8
def dump
  parts = general_prefix
  parts << text
  parts.join(' ')
end
load(string, options = {}) click to toggle source
# File lib/dns/zone/rr/txt.rb, line 14
def load(string, options = {})
  rdata = load_general_and_get_rdata(string, options)
  return nil unless rdata

  # extract text from within quotes; allow multiple quoted strings; ignore escaped quotes
  # @text = rdata.scan(/"#{DNS::Zone::RR::REGEX_STRING}"/).flatten.map { |w| %Q{"#{w}"} }.join
  @text = rdata.scan(/"#{DNS::Zone::RR::REGEX_STRING}"/).flat_map { |w| %Q{"#{w&.first}"} }.join(' ')
  self
end