Class: ChupaText::Decomposers::LibreOfficeGeneral
- Inherits:
-
Decomposer
- Object
- Decomposer
- ChupaText::Decomposers::LibreOfficeGeneral
- Includes:
- Loggable
- Defined in:
- lib/chupa-text/decomposers/libreoffice-general.rb
Instance Method Summary collapse
- #decompose(data) {|pdf_data| ... } ⇒ Object
-
#initialize(options) ⇒ LibreOfficeGeneral
constructor
A new instance of LibreOfficeGeneral.
- #target?(data) ⇒ Boolean
Constructor Details
#initialize(options) ⇒ LibreOfficeGeneral
Returns a new instance of LibreOfficeGeneral.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/chupa-text/decomposers/libreoffice-general.rb', line 25 def initialize() super @command = find_command debug do if @command "#{log_tag}[command][found] #{@command.path}" else "#{log_tag}[command][not-found]" end end end |
Instance Method Details
#decompose(data) {|pdf_data| ... } ⇒ Object
43 44 45 46 47 |
# File 'lib/chupa-text/decomposers/libreoffice-general.rb', line 43 def decompose(data) pdf_data = convert_to_pdf(data) return if pdf_data.nil? yield(pdf_data) end |
#target?(data) ⇒ Boolean
37 38 39 40 41 |
# File 'lib/chupa-text/decomposers/libreoffice-general.rb', line 37 def target?(data) return false if @command.nil? @extensions.include?(data.extension) or @mime_types.include?(data.mime_type) end |