[DOC] Doc for Pathname#to_s

This commit is contained in:
Burdette Lamar authored and GitHub committed 2026-07-12 12:20:26 -07:00
1 parent 7df1fefe21
commit eec3aba7a3
1 file changed
+11 -2
Notes: git 2026-07-12 19:20:56 +00:00
+11 -2
View File
@@ -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: