Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Resolv::DNS::Name#to_s
() -> untyped
to_s
lib/resolv.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/resolv.rb, line 1363
def to_s
return @labels.join('.')
end
returns the domain name as a string.
The domain name doesn’t have a trailing dot even if the name object is absolute.
Example:
Example
p Resolv::DNS::Name.create("x.y.z.").to_s #=> "x.y.z" p Resolv::DNS::Name.create("x.y.z").to_s #=> "x.y.z"