method

each

v1_8_6_287 - Show latest stable - Class: Dir
each()
public

Calls the block once for each entry in this directory, passing the filename of each entry as a parameter to the block.

   d = Dir.new("testdir")
   d.each  {|x| puts "Got #{x}" }

produces:

   Got .
   Got ..
   Got config.h
   Got main.rb