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 skip_first?(accumulator) | |
return 1 if accumulator.nil? | |
return 0 unless accumulator.nil? | |
end | |
def my_inject(accumulator = nil) | |
start = skip_first? accumulator | |
accumulator ||= self.first |