Sha256: fb808510001c622aa2066740692a82ea573bafd221f0d2136fb711c433705a88
Contents?: true
Size: 760 Bytes
Versions: 1
Compression:
Stored size: 760 Bytes
Contents
# frozen_string_literal: true require "simple_text_extract/format_extractor/base" require "simple_text_extract/format_extractor/plain_text" require "simple_text_extract/format_extractor/pdf" require "simple_text_extract/format_extractor/doc_x" require "simple_text_extract/format_extractor/doc" module SimpleTextExtract class FormatExtractorFactory 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) else FormatExtractor::Base.new(file) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
simple_text_extract-0.1.0 | lib/simple_text_extract/format_extractor_factory.rb |