Permalink
Browse files

Support to return enumerator when no block given

  • Loading branch information...
ksss committed Mar 15, 2017
1 parent 673ce23 commit 4ee79a877728f07c2017ba0a225bf9647bfca22a
Showing with 1 addition and 0 deletions.
  1. +1 −0 mrblib/string.rb
View
@@ -10,6 +10,7 @@ class String
#
# ISO 15.2.10.5.15
def each_line(rs = "\n", &block)
return to_enum(:each_line, rs, &block) unless block
return block.call(self) if rs.nil?
rs = rs.to_str
offset = 0

0 comments on commit 4ee79a8

Please sign in to comment.