Skip to content

Instantly share code, notes, and snippets.

@vaxinate
Created May 22, 2013 20:19
Show Gist options
  • Save vaxinate/5630571 to your computer and use it in GitHub Desktop.
Save vaxinate/5630571 to your computer and use it in GitHub Desktop.
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