module Parchment

Constants

VERSION

Public Class Methods

read(path) click to toggle source

Reads path and determines which format module to use for reading the file.

# File lib/parchment.rb, line 11
def self.read(path)
  extension = path.split('.').last
  case extension
  when 'odt'
    Parchment::ODT.read(path)
  when 'docx'
    Parchment::DOCX.read(path)
  when 'txt'
    Parchment::TXT.read(path)
  else
    raise UnsupportedFileFormatError, 'File format is not supported.'
  end
end