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

Inherits:
Resolv::DNS::Resource show all
Defined in:
lib/logstash/patches/resolv_9270.rb

Overview

Unstructured text resource.

Constant Summary collapse

TypeValue =

:nodoc:

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.



2039
2040
2041
# File 'lib/logstash/patches/resolv_9270.rb', line 2039

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

Instance Attribute Details

#stringsObject (readonly)

Returns an Array of Strings for this TXT record.



2046
2047
2048
# File 'lib/logstash/patches/resolv_9270.rb', line 2046

def strings
  @strings
end

Class Method Details

.decode_rdata(msg) ⇒ Object

:nodoc:



2059
2060
2061
2062
# File 'lib/logstash/patches/resolv_9270.rb', line 2059

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

Instance Method Details

#dataObject

Returns the concatenated string from strings.



2051
2052
2053
# File 'lib/logstash/patches/resolv_9270.rb', line 2051

def data
  @strings.join("")
end

#encode_rdata(msg) ⇒ Object

:nodoc:



2055
2056
2057
# File 'lib/logstash/patches/resolv_9270.rb', line 2055

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