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

Inherits:
Resource
  • Object
show all
Defined in:
lib/resolv.rb

Overview

Unstructured text resource.

Constant Summary collapse

TypeValue =

:nodoc:

16

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(first_string, *rest_strings) ⇒ TXT

Returns a new instance of TXT.



2645
2646
2647
# File 'lib/resolv.rb', line 2645

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

Instance Attribute Details

#strings ⇒ Object (readonly)

Returns an Array of Strings for this TXT record.



2652
2653
2654
# File 'lib/resolv.rb', line 2652

def strings
  @strings
end

Class Method Details

.decode_rdata(msg) ⇒ Object

:nodoc:



2665
2666
2667
2668
# File 'lib/resolv.rb', line 2665

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

Instance Method Details

#data ⇒ Object

Returns the concatenated string from strings.



2657
2658
2659
# File 'lib/resolv.rb', line 2657

def data
  @strings.join("")
end

#encode_rdata(msg) ⇒ Object

:nodoc:



2661
2662
2663
# File 'lib/resolv.rb', line 2661

def encode_rdata(msg) # :nodoc:
  msg.put_string_list(@strings)
end