method
entries
entries()
public
Return the entries (files and subdirectories) in the directory, each as a Pathname object.
The results contains just the names in the directory, without any trailing slashes or recursive look-up.
pp Pathname.new('/usr/local').entries #=> [#<Pathname:share>, # #<Pathname:lib>, # #<Pathname:..>, # #<Pathname:include>, # #<Pathname:etc>, # #<Pathname:bin>, # #<Pathname:man>, # #<Pathname:games>, # #<Pathname:.>, # #<Pathname:sbin>, # #<Pathname:src>]
The result may contain the current directory #
If you don’t want . and .. and want directories, consider Pathname#children.