Skip to content

Commit

Permalink
Support to return enumerator when no block given
Browse files Browse the repository at this point in the history
  • Loading branch information
ksss committed Mar 15, 2017
1 parent 673ce23 commit 4ee79a8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mrblib/string.rb
Expand Up @@ -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
Expand Down

0 comments on commit 4ee79a8

Please sign in to comment.