Skip to content

Instantly share code, notes, and snippets.

View Vanderln's full-sized avatar

Bill Van Der Laan Vanderln

View GitHub Profile
@Vanderln
Vanderln / socarraypad
Created March 1, 2013 17:22
Socrates Array padding problem
class Array
def pad!(min_size, value = nil)
if min_size <= self.length
self
else
(min_size - self.length).times{|x| self.push(value)}
self
end
end