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

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

Constant Summary collapse

TypeValue =
16

Constants inherited from Resolv::DNS::Resource

ClassHash, ClassInsensitiveTypes, ClassValue

Instance Attribute Summary collapse

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.



1602
1603
1604
# File 'lib/resolv.rb', line 1602

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

Instance Attribute Details

#stringsObject (readonly)

Returns the value of attribute strings



1605
1606
1607
# File 'lib/resolv.rb', line 1605

def strings
  @strings
end

Class Method Details

.decode_rdata(msg) ⇒ Object



1615
1616
1617
1618
# File 'lib/resolv.rb', line 1615

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

Instance Method Details

#dataObject



1607
1608
1609
# File 'lib/resolv.rb', line 1607

def data
  @strings[0]
end

#encode_rdata(msg) ⇒ Object



1611
1612
1613
# File 'lib/resolv.rb', line 1611

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