Class: Dnsruby::RR::HINFO
- Inherits:
-
Dnsruby::RR
- Object
- Dnsruby::RR
- Dnsruby::RR::HINFO
- Defined in:
- lib/dnsruby/resource/HINFO.rb
Overview
Class for DNS Host Information (HINFO) resource records.
Constant Summary collapse
Constants inherited from Dnsruby::RR
Instance Attribute Summary collapse
-
#cpu ⇒ Object
The CPU type for this RR.
-
#os ⇒ Object
The operating system type for this RR.
Attributes inherited from Dnsruby::RR
#klass, #name, #rdata, #ttl, #type
Class Method Summary collapse
-
.decode_rdata(msg) ⇒ Object
:nodoc: all.
Instance Method Summary collapse
-
#encode_rdata(msg, canonical = false) ⇒ Object
:nodoc: all.
-
#from_data(data) ⇒ Object
:nodoc: all.
-
#from_string(input) ⇒ Object
:nodoc: all.
-
#rdata_to_string ⇒ Object
:nodoc: all.
Methods inherited from Dnsruby::RR
#<=>, #==, #clone, create, #eql?, find_class, #from_hash, get_class, get_num, #hash, implemented_rrs, #init_defaults, new_from_data, new_from_hash, new_from_string, #rdlength, #sameRRset, #to_s
Instance Attribute Details
#cpu ⇒ Object
The CPU type for this RR.
24 25 26 |
# File 'lib/dnsruby/resource/HINFO.rb', line 24 def cpu @cpu end |
#os ⇒ Object
The operating system type for this RR.
26 27 28 |
# File 'lib/dnsruby/resource/HINFO.rb', line 26 def os @os end |
Class Method Details
.decode_rdata(msg) ⇒ Object
:nodoc: all
65 66 67 68 69 |
# File 'lib/dnsruby/resource/HINFO.rb', line 65 def self.decode_rdata(msg) #:nodoc: all cpu = msg.get_string os = msg.get_string return self.new([cpu, os]) end |
Instance Method Details
#encode_rdata(msg, canonical = false) ⇒ Object
:nodoc: all
60 61 62 63 |
# File 'lib/dnsruby/resource/HINFO.rb', line 60 def encode_rdata(msg, canonical=false) #:nodoc: all msg.put_string(@cpu) msg.put_string(@os) end |
#from_data(data) ⇒ Object
:nodoc: all
28 29 30 |
# File 'lib/dnsruby/resource/HINFO.rb', line 28 def from_data(data) #:nodoc: all @cpu, @os= data end |
#from_string(input) ⇒ Object
:nodoc: all
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/dnsruby/resource/HINFO.rb', line 32 def from_string(input) #:nodoc: all strings = TXT.parse(input) cpu = "" os = "" if (strings.length == 1) cpu, os = input.split(" ") else cpu = strings[0] os = strings[1] end cpu.sub!(/^\"/, "") @cpu = cpu.sub(/\"$/, "") os.sub!(/^\"/, "") @os = os.sub(/\"$/, "") end |