Class: DNS::Zone::RR::HINFO
Overview
‘HINFO` resource record.
RFC 1035
Constant Summary collapse
- REGEX_HINFO_RDATA =
%r{ (?<cpu>(?:#{DNS::Zone::RR::REGEX_CHARACTER_STRING})){1}\s (?<os>(?:#{DNS::Zone::RR::REGEX_CHARACTER_STRING})){1} }mx
Instance Attribute Summary collapse
-
#cpu ⇒ Object
Returns the value of attribute cpu.
-
#os ⇒ Object
Returns the value of attribute os.
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
#cpu ⇒ Object
Returns the value of attribute cpu.
10 11 12 |
# File 'lib/dns/zone/rr/hinfo.rb', line 10 def cpu @cpu end |
#os ⇒ Object
Returns the value of attribute os.
11 12 13 |
# File 'lib/dns/zone/rr/hinfo.rb', line 11 def os @os end |
Instance Method Details
#dump ⇒ Object
13 14 15 16 17 |
# File 'lib/dns/zone/rr/hinfo.rb', line 13 def dump parts = general_prefix parts << %Q{"#{cpu}" "#{os}"} parts.join(' ') end |
#load(string, options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/dns/zone/rr/hinfo.rb', line 19 def load(string, = {}) rdata = load_general_and_get_rdata(string, ) return nil unless rdata captures = rdata.match(REGEX_HINFO_RDATA) return nil unless captures @cpu = captures[:cpu].scan(/#{DNS::Zone::RR::REGEX_CHARACTER_STRING}/).join @os = captures[:os].scan(/#{DNS::Zone::RR::REGEX_CHARACTER_STRING}/).join self end |