Class: DNS::Zone::RR::NSEC

Inherits:
Record
  • Object
show all
Defined in:
lib/dns/zone/rr/nsec.rb

Overview

‘NSEC` resource record.

RFC 4034

Constant Summary collapse

REGEX_NSEC_RDATA =
%r{
  (?<next_domain>#{DNS::Zone::RR::REGEX_DOMAINNAME})\s*
  (?<rrset_types>#{DNS::Zone::RR::REGEX_STRING})\s*
}mx

Instance Attribute Summary collapse

Attributes inherited from Record

#klass, #label, #ttl

Instance Method Summary collapse

Methods inherited from Record

#general_prefix, #initialize, #load_general_and_get_rdata, #type

Constructor Details

This class inherits a constructor from DNS::Zone::RR::Record

Instance Attribute Details

#next_domainObject

Returns the value of attribute next_domain.



11
12
13
# File 'lib/dns/zone/rr/nsec.rb', line 11

def next_domain
  @next_domain
end

#rrset_typesObject

Returns the value of attribute rrset_types.



11
12
13
# File 'lib/dns/zone/rr/nsec.rb', line 11

def rrset_types
  @rrset_types
end

Instance Method Details

#dumpObject



13
14
15
16
17
18
# File 'lib/dns/zone/rr/nsec.rb', line 13

def dump
  parts = general_prefix
  parts << next_domain
  parts << rrset_types
  parts.join(' ')
end

#load(string, options = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/dns/zone/rr/nsec.rb', line 20

def load(string, options = {})
  rdata = load_general_and_get_rdata(string, options)
  return nil unless rdata

  captures = rdata.match(REGEX_NSEC_RDATA)
  return nil unless captures

  @next_domain = captures[:next_domain]
  @rrset_types = captures[:rrset_types]
  self
end