Created
May 22, 2013 20:19
-
-
Save vaxinate/5630571 to your computer and use it in GitHub Desktop.
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 RanVer | |
def self.generate | |
segments = [] | |
2.times do | |
segments << case rand(10) + 1 | |
when 1 | |
rand(1000) | |
when 2..3 | |
rand(100) | |
else | |
rand(10) | |
end | |
end | |
segments << case rand(10) + 1 | |
when 1 | |
rand(1000) + 1 | |
when 2..5 | |
rand(100) + 1 | |
else | |
rand(10) + 1 | |
end | |
segments.join '.' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment