Class: Dnsruby::RR::HINFO

Inherits:
Dnsruby::RR show all
Defined in:
lib/Dnsruby/resource/HINFO.rb

Overview

Class for DNS Host Information (HINFO) resource records.

Constant Summary collapse

ClassValue =

:nodoc: all

nil
TypeValue =

:nodoc: all

Types::HINFO

Constants inherited from Dnsruby::RR

ClassInsensitiveTypes

Instance Attribute Summary collapse

Attributes inherited from Dnsruby::RR

#klass, #name, #rdata, #ttl, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Dnsruby::RR

#==, create, #eql?, #from_hash, get_class, #hash, implemented_rrs, #init_defaults, new_from_data, new_from_hash, new_from_string, #rdlength, #sameRRset, #to_s

Instance Attribute Details

#cpuObject

The CPU type for this RR.



24
25
26
# File 'lib/Dnsruby/resource/HINFO.rb', line 24

def cpu
  @cpu
end

#osObject

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



45
46
47
48
49
# File 'lib/Dnsruby/resource/HINFO.rb', line 45

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) ⇒ Object

:nodoc: all



40
41
42
43
# File 'lib/Dnsruby/resource/HINFO.rb', line 40

def encode_rdata(msg) #: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
# File 'lib/Dnsruby/resource/HINFO.rb', line 32

def from_string(input) #:nodoc: all
  @cpu, @os = input.split(" ")
end

#rdata_to_stringObject

:nodoc: all



36
37
38
# File 'lib/Dnsruby/resource/HINFO.rb', line 36

def rdata_to_string #:nodoc: all
  return "#{@cpu} #{@os}"
end