method

each_child

Importance_1
v2_6_3 - Show latest stable - 0 notes - Class: Dir
each_child(*args) public

Calls the block once for each entry except for “.” and “..” in the named directory, passing the filename of each entry as a parameter to the block.

If no block is given, an enumerator is returned instead.

Dir.each_child("testdir") {|x| puts "Got #{x}" }

produces:

Got config.h
Got main.rb
Show source
Register or log in to add new notes.