The documentation is using File.directory?(“/path/to/directory”), but the method being referred to is Dir.exists?().
Dir.exists?(".") => true
The source code is the same as File.directory?().