Created
March 2, 2014 16:13
-
-
Save xander-miller/9308806 to your computer and use it in GitHub Desktop.
Sheldon's exercise
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 sum | |
sum = 0 | |
self.each do |item| | |
#some code | |
end | |
sum | |
end | |
def add_index | |
item_with_index_array = [] | |
self.each_with_index do |item, index| | |
#some code | |
end | |
item_with_index_array | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment