Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Pathname#each_entry

() { (::Pathname) -> untyped } -> nil
each_entry {|entry| ... } → nil
each_entry → new_enumerator

With a block given, yields a new pathname for each entry in the entry represented by self; returns nil:

Example
Pathname('include').each_entry {|entry| p entry }
# #<Pathname:ruby>
# #<Pathname:..>
# #<Pathname:ruby.h>
# #<Pathname:.>
# => nil

With no block given, returns a new Enumerator.

See also #each_child #each_filename #dirname #each_line also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0