Skip to content

Instantly share code, notes, and snippets.

@kristjan
Created January 11, 2011 22:48
Show Gist options
  • Save kristjan/775321 to your computer and use it in GitHub Desktop.
Save kristjan/775321 to your computer and use it in GitHub Desktop.
Handles what you meant when you said [rand]*3
class Fixnum
def of
result = []
self.times {|i| result << yield(i)}
result
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment