Class: Resolv::DNS::Resource::TXT
- Inherits:
-
Resolv::DNS::Resource
- Object
- Query
- Resolv::DNS::Resource
- Resolv::DNS::Resource::TXT
- Defined in:
- lib/resolv.rb
Overview
Unstructured text resource.
Constant Summary collapse
- TypeValue =
:nodoc:
16
Constants inherited from Resolv::DNS::Resource
ClassHash, ClassInsensitiveTypes, ClassValue
Instance Attribute Summary collapse
-
#strings ⇒ Object
readonly
Returns an Array of Strings for this TXT record.
Attributes inherited from Resolv::DNS::Resource
Class Method Summary collapse
-
.decode_rdata(msg) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#data ⇒ Object
Returns the first string from
strings
. -
#encode_rdata(msg) ⇒ Object
:nodoc:.
-
#initialize(first_string, *rest_strings) ⇒ TXT
constructor
A new instance of TXT.
Methods inherited from Resolv::DNS::Resource
Constructor Details
#initialize(first_string, *rest_strings) ⇒ TXT
Returns a new instance of TXT.
1925 1926 1927 |
# File 'lib/resolv.rb', line 1925 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.
1932 1933 1934 |
# File 'lib/resolv.rb', line 1932 def strings @strings end |
Class Method Details
.decode_rdata(msg) ⇒ Object
:nodoc:
1945 1946 1947 1948 |
# File 'lib/resolv.rb', line 1945 def self.decode_rdata(msg) # :nodoc: strings = msg.get_string_list return self.new(*strings) end |
Instance Method Details
#data ⇒ Object
Returns the first string from strings
.
1937 1938 1939 |
# File 'lib/resolv.rb', line 1937 def data @strings[0] end |
#encode_rdata(msg) ⇒ Object
:nodoc:
1941 1942 1943 |
# File 'lib/resolv.rb', line 1941 def encode_rdata(msg) # :nodoc: msg.put_string_list(@strings) end |