Class: DNS::Zone::RR::SOA
Overview
‘SRV` resource record.
RFC 1035
Constant Summary collapse
- REGEX_SOA_RDATA =
%r{ (?<nameserver>#{DNS::Zone::RR::REGEX_DOMAINNAME})\s* # get nameserver domainname (?<email>#{DNS::Zone::RR::REGEX_DOMAINNAME})\s* # get mailbox domainname (?<serial>\d+)\s* (?<refresh_ttl>#{DNS::Zone::RR::REGEX_TTL})\s* (?<retry_ttl>#{DNS::Zone::RR::REGEX_TTL})\s* (?<expiry_ttl>#{DNS::Zone::RR::REGEX_TTL})\s* (?<minimum_ttl>#{DNS::Zone::RR::REGEX_TTL})\s* }mx
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#expiry_ttl ⇒ Object
Returns the value of attribute expiry_ttl.
-
#minimum_ttl ⇒ Object
Returns the value of attribute minimum_ttl.
-
#nameserver ⇒ Object
Returns the value of attribute nameserver.
-
#refresh_ttl ⇒ Object
Returns the value of attribute refresh_ttl.
-
#retry_ttl ⇒ Object
Returns the value of attribute retry_ttl.
-
#serial ⇒ Object
Returns the value of attribute serial.
Attributes inherited from Record
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
#email ⇒ Object
Returns the value of attribute email.
16 17 18 |
# File 'lib/dns/zone/rr/soa.rb', line 16 def email @email end |
#expiry_ttl ⇒ Object
Returns the value of attribute expiry_ttl.
16 17 18 |
# File 'lib/dns/zone/rr/soa.rb', line 16 def expiry_ttl @expiry_ttl end |
#minimum_ttl ⇒ Object
Returns the value of attribute minimum_ttl.
16 17 18 |
# File 'lib/dns/zone/rr/soa.rb', line 16 def minimum_ttl @minimum_ttl end |
#nameserver ⇒ Object
Returns the value of attribute nameserver.
16 17 18 |
# File 'lib/dns/zone/rr/soa.rb', line 16 def nameserver @nameserver end |
#refresh_ttl ⇒ Object
Returns the value of attribute refresh_ttl.
16 17 18 |
# File 'lib/dns/zone/rr/soa.rb', line 16 def refresh_ttl @refresh_ttl end |
#retry_ttl ⇒ Object
Returns the value of attribute retry_ttl.
16 17 18 |
# File 'lib/dns/zone/rr/soa.rb', line 16 def retry_ttl @retry_ttl end |
#serial ⇒ Object
Returns the value of attribute serial.
16 17 18 |
# File 'lib/dns/zone/rr/soa.rb', line 16 def serial @serial end |
Instance Method Details
#dump ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/dns/zone/rr/soa.rb', line 18 def dump parts = general_prefix parts << nameserver parts << email parts << '(' parts << serial parts << refresh_ttl parts << retry_ttl parts << expiry_ttl parts << minimum_ttl parts << ')' parts.join(' ') end |
#load(string, options = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/dns/zone/rr/soa.rb', line 33 def load(string, = {}) rdata = load_general_and_get_rdata(string, ) return nil unless rdata captures = rdata.match(REGEX_SOA_RDATA) return nil unless captures @nameserver = captures[:nameserver] @email = captures[:email] @serial = captures[:serial].to_i @refresh_ttl = captures[:refresh_ttl] @retry_ttl = captures[:retry_ttl] @expiry_ttl = captures[:expiry_ttl] @minimum_ttl = captures[:minimum_ttl] self end |