Module: Parchment
- Defined in:
- lib/parchment.rb,
lib/parchment/style.rb,
lib/parchment/helpers.rb,
lib/parchment/version.rb,
lib/parchment/document.rb,
lib/parchment/text_run.rb,
lib/parchment/paragraph.rb,
lib/parchment/formats/odt/odt.rb,
lib/parchment/formats/docx/docx.rb,
lib/parchment/formats/odt/style.rb,
lib/parchment/formats/docx/style.rb,
lib/parchment/formats/odt/document.rb,
lib/parchment/formats/odt/text_run.rb,
lib/parchment/formats/docx/document.rb,
lib/parchment/formats/docx/text_run.rb,
lib/parchment/formats/odt/paragraph.rb,
lib/parchment/formats/docx/paragraph.rb
Defined Under Namespace
Modules: DOCX, Helpers, ODT Classes: Document, MissingFormatterMethodError, Paragraph, Style, TextRun, UnsupportedFileFormatError
Constant Summary collapse
- VERSION =
'0.0.1'
Class Method Summary collapse
-
.read(path) ⇒ Object
Reads
pathand determines which format module to use for reading the file.
Class Method Details
.read(path) ⇒ Object
Reads path and determines which format module to use for reading the file.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/parchment.rb', line 10 def self.read(path) extension = path.split('.').last case extension when 'odt' Parchment::ODT.read(path) when 'docx' Parchment::DOCX.read(path) else raise UnsupportedFileFormatError, 'File format is not supported.' end end |