Class: Tahweel::Writers::Txt
- Inherits:
-
Object
- Object
- Tahweel::Writers::Txt
- Defined in:
- lib/tahweel/writers/txt.rb
Overview
Writer class for outputting text to a .txt file.
Constant Summary collapse
- PAGE_SEPARATOR =
"\n\nPAGE_SEPARATOR\n\n"
Instance Method Summary collapse
-
#extension ⇒ String
Returns the file extension for this writer.
-
#write(texts, destination, options = {}) ⇒ void
Writes the extracted texts to a file.
Instance Method Details
#extension ⇒ String
Returns the file extension for this writer.
12 |
# File 'lib/tahweel/writers/txt.rb', line 12 def extension = "txt" |
#write(texts, destination, options = {}) ⇒ void
This method returns an undefined value.
Writes the extracted texts to a file.
21 22 23 24 |
# File 'lib/tahweel/writers/txt.rb', line 21 def write(texts, destination, = {}) separator = [:page_separator] || PAGE_SEPARATOR File.write(destination, texts.map(&:strip).join(separator)) end |