Skip to content

Commit 4ee79a8

Browse files
committed
Support to return enumerator when no block given
1 parent 673ce23 commit 4ee79a8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mrblib/string.rb

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class String
1010
#
1111
# ISO 15.2.10.5.15
1212
def each_line(rs = "\n", &block)
13+
return to_enum(:each_line, rs, &block) unless block
1314
return block.call(self) if rs.nil?
1415
rs = rs.to_str
1516
offset = 0

0 commit comments

Comments
 (0)