Class: Webster

Inherits:
Object
  • Object
show all
Defined in:
lib/webster.rb

Constant Summary collapse

DICTIONARY =
File.open(File.join(File.dirname(__FILE__), 'words')) do |file|
  file.readlines.collect {|each| each.chomp}
end

Instance Method Summary collapse

Instance Method Details

#random_wordObject



7
8
9
# File 'lib/webster.rb', line 7

def random_word
  DICTIONARY[rand(DICTIONARY.size)]
end