Class: DNS::Zone::RR::DS
Overview
‘DS` resource record.
RFC 4034
Constant Summary collapse
- REGEX_DS_RDATA =
%r{ (?<key_tag>\d+)\s* (?<algorithm>\d+)\s* (?<digest_type>\d+)\s* (?<digest>#{DNS::Zone::RR::REGEX_STRING})\s* }mx
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
Returns the value of attribute algorithm.
-
#digest ⇒ Object
Returns the value of attribute digest.
-
#digest_type ⇒ Object
Returns the value of attribute digest_type.
-
#key_tag ⇒ Object
Returns the value of attribute key_tag.
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
#algorithm ⇒ Object
Returns the value of attribute algorithm.
13 14 15 |
# File 'lib/dns/zone/rr/ds.rb', line 13 def algorithm @algorithm end |
#digest ⇒ Object
Returns the value of attribute digest.
13 14 15 |
# File 'lib/dns/zone/rr/ds.rb', line 13 def digest @digest end |
#digest_type ⇒ Object
Returns the value of attribute digest_type.
13 14 15 |
# File 'lib/dns/zone/rr/ds.rb', line 13 def digest_type @digest_type end |
#key_tag ⇒ Object
Returns the value of attribute key_tag.
13 14 15 |
# File 'lib/dns/zone/rr/ds.rb', line 13 def key_tag @key_tag end |
Instance Method Details
#dump ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/dns/zone/rr/ds.rb', line 15 def dump parts = general_prefix parts << key_tag parts << algorithm parts << digest_type parts << digest parts.join(' ') end |
#load(string, options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dns/zone/rr/ds.rb', line 24 def load(string, = {}) rdata = load_general_and_get_rdata(string, ) return nil unless rdata captures = rdata.match(REGEX_DS_RDATA) return nil unless captures @key_tag = captures[:key_tag].to_i @algorithm = captures[:algorithm].to_i @digest_type = captures[:digest_type].to_i @digest = captures[:digest].scan(/#{DNS::Zone::RR::REGEX_STRING}/).join self end |