Class: SimpleTextExtract::FormatExtractorFactory
- Inherits:
-
Object
- Object
- SimpleTextExtract::FormatExtractorFactory
- Defined in:
- lib/simple_text_extract/format_extractor_factory.rb
Class Method Summary collapse
-
.call(file) ⇒ Object
rubocop:disable Metrics/MethodLength.
Class Method Details
.call(file) ⇒ Object
rubocop:disable Metrics/MethodLength
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/simple_text_extract/format_extractor_factory.rb', line 12 def self.call(file) # rubocop:disable Metrics/MethodLength case file.path when /.txt$/i FormatExtractor::PlainText.new(file) when /.pdf$/i FormatExtractor::PDF.new(file) when /.docx$/i FormatExtractor::DocX.new(file) when /.doc$/i FormatExtractor::Doc.new(file) when /(.xlsx$|.xls$)/i FormatExtractor::XlsX.new(file) else FormatExtractor::Base.new(file) end end |