Module: RandomPhrase::Dictionary

Defined in:
lib/random_phrase/dictionary.rb

Class Method Summary collapse

Class Method Details

.loadObject



2
3
4
5
6
7
8
# File 'lib/random_phrase/dictionary.rb', line 2

def self.load
  if File.exists?("config/words")
	File.read("config/words").split
else
	"flowing hill".split
end
end

.wordsObject



10
11
12
# File 'lib/random_phrase/dictionary.rb', line 10

def self.words
	@@dictionary ||= self.load
end