Class: Turboname::Random

Inherits:
Dictionary show all
Defined in:
lib/turboname/random_dictionary.rb

Instance Method Summary collapse

Instance Method Details

#getObject

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



4
5
6
7
8
9
10
11
# 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