Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
Pathname.pwd
() -> ::Pathname
pwd
pathname_builtin.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/pathname_builtin.rb, line 2836
def Pathname.getwd() self.new(Dir.getwd) end
Alias of .getwd
Returns a new Pathname object containing the path to the current working directory (equivalent to Pathname.new(Dir.getwd)):
Example
Pathname.getwd # => #<Pathname:/home>