Enumerable#cycle to return enumerator

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-03-27 14:34:21 +09:00
parent 8250016136
commit fc51781402
+2
View File
@@ -552,6 +552,8 @@ module Enumerable
#
def cycle(n=nil, &block)
return to_enum :cycle if !block_given? && n == nil
ary = []
if n == nil
self.each do|*val|