diff options
Diffstat (limited to 'mrblib')
| -rw-r--r-- | mrblib/array.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mrblib/array.rb b/mrblib/array.rb index e248914e8..6708027ab 100644 --- a/mrblib/array.rb +++ b/mrblib/array.rb @@ -10,16 +10,16 @@ class Array # and pass the respective element. # # ISO 15.2.12.5.10 - # def each(&block) - # return to_enum :each unless block - # - # idx = 0 - # while idx < length - # block.call(self[idx]) - # idx += 1 - # end - # self - # end + def each(&block) + return to_enum :each unless block + + idx = 0 + while idx < length + block.call(self[idx]) + idx += 1 + end + self + end ## # Calls the given block for each element of +self+ |
