Sunday, June 5, 2016

Alexander Goldstein's Each! Pattern

class Array
 def each!
  while count > 0
   yield(shift)
  end
 end
end

No comments:

Post a Comment