Created
October 11, 2013 15:30
-
-
Save gregeng/6936756 to your computer and use it in GitHub Desktop.
my_each
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Array | |
def my_each | |
i = 0 | |
while i < self.length | |
yield(self[i]) | |
i+=1 | |
end | |
self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment