class Turboname::Random

Public Instance Methods

get() click to toggle source

let's get a random word out of the dictionary and modify it, also randomly

# File lib/turboname/random_dictionary.rb, line 4
def get
  vowels = ["a","e","i","o","u"]
  line = File.readlines(File.join(Turboname::path, 'dictionary.txt'))[rand(435000)-1].gsub("\n","")
  rand(20).times do
    line = line.gsub(vowels.shuffle.first, vowels.shuffle.first)
  end
  line
end