diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-27 14:34:21 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-27 14:34:21 +0900 |
| commit | fc51781402d35f182772d810f15705899d366f03 (patch) | |
| tree | 724feb5c734b00c74888c1eada65b581633591a8 | |
| parent | 8250016136a9099fd8f556acd7bba85fa15b609a (diff) | |
| download | mruby-fc51781402d35f182772d810f15705899d366f03.tar.gz mruby-fc51781402d35f182772d810f15705899d366f03.zip | |
Enumerable#cycle to return enumerator
| -rw-r--r-- | mrbgems/mruby-enum-ext/mrblib/enum.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mrbgems/mruby-enum-ext/mrblib/enum.rb b/mrbgems/mruby-enum-ext/mrblib/enum.rb index d6959e26f..2affe555f 100644 --- a/mrbgems/mruby-enum-ext/mrblib/enum.rb +++ b/mrbgems/mruby-enum-ext/mrblib/enum.rb @@ -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| |
