Module: EnglishDictionary
- Defined in:
- lib/english_dictionary.rb,
lib/english_dictionary/version.rb
Overview
All code in the gem is namespaced under this module.
Constant Summary collapse
- VERSION =
The current version of EnglishDictionary.
"1.0.1"
- @@words =
{}
Class Method Summary collapse
Class Method Details
.is_word(word) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/english_dictionary.rb', line 16 def self.is_word(word) if @@words[word] == true puts "true" else puts "false" end end |
.load_words ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/english_dictionary.rb', line 8 def self.load_words() File.open("words.txt") do |file| file.each do |line| @@words[line.strip] = true end end end |