Class: Libis::Format::Converter::OfficeConverter
- Defined in:
- lib/libis/format/converter/office_converter.rb
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
category, #check_file_exist, inherited, #initialize, #using_temp, using_temp
Constructor Details
This class inherits a constructor from Libis::Format::Converter::Base
Class Method Details
.input_types ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/libis/format/converter/office_converter.rb', line 14 def self.input_types [ :TXT, :RTF, :HTML, :MSDOC, :MSDOT, :MSXLS, :MSPPT, :MSDOCX, :MSDOTX, :MSXLSX, :MSPPTX, :WORDPERFECT, :OO_WRITER, :OO_IMPRESS, :OO_CALC ] end |
.output_types(format = nil) ⇒ Object
34 35 36 37 |
# File 'lib/libis/format/converter/office_converter.rb', line 34 def self.output_types(format = nil) return [] unless input_types.include?(format) if format [:PDF] end |
Instance Method Details
#convert(source, target, format, opts = {}) ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/libis/format/converter/office_converter.rb', line 43 def convert(source, target, format, opts = {}) super return nil unless Format::Tool::OfficeToPdf.run(source, target) target end |
#office_convert(_) ⇒ Object
39 40 41 |
# File 'lib/libis/format/converter/office_converter.rb', line 39 def office_convert(_) #force usage of this converter end |