From eec3aba7a3abbc5bbdafdca81099dceb9c03bf4a Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Sun, 12 Jul 2026 14:20:26 -0500 Subject: [PATCH] [DOC] Doc for Pathname#to_s --- pathname_builtin.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pathname_builtin.rb b/pathname_builtin.rb index 88bc9bba9c..dc9f81a3b3 100644 --- a/pathname_builtin.rb +++ b/pathname_builtin.rb @@ -281,12 +281,21 @@ class Pathname @path.hash end - # Return the path as a String. + # :markup: markdown + # + # call-seq: + # to_s -> string + # + # Returns a copy of the string path in `self`: + # + # ```ruby + # Pathname('nosuch/foo/bar').to_s # => "nosuch/foo/bar" + # ``` + # def to_s @path.dup end - # to_path is implemented so Pathname objects are usable with File.open, etc. alias to_path to_s def inspect # :nodoc: