Class: Phronomy::Loader::PlainTextLoader
- Defined in:
- lib/phronomy/loader/plain_text_loader.rb
Overview
Loads a plain-text file as a single document.
Instance Method Summary collapse
-
#load(source) ⇒ Array<Hash>
Single-element array with the file contents.
Instance Method Details
#load(source) ⇒ Array<Hash>
Returns single-element array with the file contents.
15 16 17 18 |
# File 'lib/phronomy/loader/plain_text_loader.rb', line 15 def load(source) text = File.read(source, encoding: "UTF-8") [{text: text, metadata: {source: source}}] end |