Ruby 2.0.0 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Enumeratorクラス > each
each {...} -> object[permalink][rdoc]生成時のパラメータに従ってブロックを繰り返します。 生成時に指定したイテレータの戻り値をそのまま返します。
例:
str = "Yet Another Ruby Hacker"
enum = Enumerator.new(str, :scan, /\w+/)
enum.each {|word| p word } # => "Yet"
# "Another"
# "Ruby"
# "Hacker"
str.scan(/\w+/) {|word| p word } # => "Yet"
# "Another"
# "Ruby"
# "Hacker"