Class: Treat::Workers::Formatters::Readers::TXT

Inherits:
Object
  • Object
show all
Defined in:
lib/treat/workers/formatters/readers/txt.rb

Overview

This class simply reads a plain text file.

Class Method Summary collapse

Class Method Details

.read(document, options = {}) ⇒ Object

Build an entity from a string in plain text format.

Options: none.



8
9
10
11
12
# File 'lib/treat/workers/formatters/readers/txt.rb', line 8

def self.read(document, options = {})
  document.value = File.read(document.file)
  document.set :format, 'txt'
  document
end