diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-14 02:41:22 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-14 02:41:22 +0900 |
| commit | 113ab607846e63c0348758d3e13017e0ea3a45a3 (patch) | |
| tree | 379aa985de0a4c1a148bc693b2207eaf66d44bc3 /mrblib/enum.rb | |
| parent | 463c5f83c3e5f379d4dd59deb17179915fbaf93b (diff) | |
| download | mruby-113ab607846e63c0348758d3e13017e0ea3a45a3.tar.gz mruby-113ab607846e63c0348758d3e13017e0ea3a45a3.zip | |
mruby-enumerator: move definitions in core_mod.rb to mrblib core
Diffstat (limited to 'mrblib/enum.rb')
| -rw-r--r-- | mrblib/enum.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mrblib/enum.rb b/mrblib/enum.rb index e6aa682dd..53f2119b0 100644 --- a/mrblib/enum.rb +++ b/mrblib/enum.rb @@ -78,6 +78,8 @@ module Enumerable # # ISO 15.3.2.2.3 def collect(&block) + return to_enum :collect unless block_given? + ary = [] self.each{|val| ary.push(block.call(val)) |
