Skip to content
On this page

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class · Ruby 3.0

Dir

< Object include Enumerable 14 instance methods 21 class methods

Objects of class Dir are directory streams representing directories in the underlying file system. They provide a variety of ways to list directories and their contents. See also File.

The directory used in these examples contains the two regular files (config.h and main.rb), the parent directory (..), and the directory itself (.).

Class methods 21

Instance methods 14

Ruby version changes 1

  1. 3.0