Skip to content

Instantly share code, notes, and snippets.

View apostoiis's full-sized avatar

Apostolis Taxidaridis apostoiis

View GitHub Profile
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