Class: Resolv::DNS::Resource::TXT

Inherits:
Resolv::DNS::Resource show all
Defined in:
lib/logmerge/resolv.rb

Constant Summary collapse

TypeValue =
16

Constants inherited from Resolv::DNS::Resource

ClassHash, ClassInsensitiveTypes, ClassValue

Instance Attribute Summary collapse

Attributes inherited from Resolv::DNS::Resource

#ttl

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resolv::DNS::Resource

#==, #eql?, get_class, #hash

Constructor Details

#initialize(first_string, *rest_strings) ⇒ TXT

Returns a new instance of TXT.



1564
1565
1566
# File 'lib/logmerge/resolv.rb', line 1564

def initialize(first_string, *rest_strings)
  @strings = [first_string, *rest_strings]
end

Instance Attribute Details

#stringsObject (readonly)

Returns the value of attribute strings.



1567
1568
1569
# File 'lib/logmerge/resolv.rb', line 1567

def strings
  @strings
end

Class Method Details

.decode_rdata(msg) ⇒ Object



1577
1578
1579
1580
# File 'lib/logmerge/resolv.rb', line 1577

def self.decode_rdata(msg)
  strings = msg.get_string_list
  return self.new(*strings)
end

Instance Method Details

#dataObject



1569
1570
1571
# File 'lib/logmerge/resolv.rb', line 1569

def data
  @strings[0]
end

#encode_rdata(msg) ⇒ Object



1573
1574
1575
# File 'lib/logmerge/resolv.rb', line 1573

def encode_rdata(msg)
  msg.put_string_list(@strings)
end