Class: Rambling::Trie::Readers::PlainText
- Defined in:
- lib/rambling/trie/readers/plain_text.rb
Overview
File reader for ‘.txt` files.
Instance Method Summary collapse
-
#each_word(filepath) {|String| ... } ⇒ self
Yields each word read from a ‘.txt` file.
Instance Method Details
#each_word(filepath) {|String| ... } ⇒ self
Yields each word read from a ‘.txt` file.
12 13 14 15 16 17 18 |
# File 'lib/rambling/trie/readers/plain_text.rb', line 12 def each_word filepath return enum_for :each_word, filepath unless block_given? ::File.foreach(filepath) { |line| yield line.chomp! } self end |