Class: Libis::Format::Converter::OfficeConverter

Inherits:
Base
  • Object
show all
Defined in:
lib/libis/format/converter/office_converter.rb

Instance Attribute Summary

Attributes inherited from Base

#flags, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited, #initialize, #using_temp, using_temp

Constructor Details

This class inherits a constructor from Libis::Format::Converter::Base

Class Method Details

.input_typesObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/libis/format/converter/office_converter.rb', line 14

def self.input_types
  [
      :TXT,
      :RTF,
      :HTML,
      :MSDOC,
      :MSXLS,
      :MSPPT,
      :MSDOCX,
      :MSXLSX,
      :MSPPTX,
      :WORDPERFECT,
  ]
end

.output_types(format = nil) ⇒ Object



29
30
31
32
# File 'lib/libis/format/converter/office_converter.rb', line 29

def self.output_types(format = nil)
  return [] unless input_types.include?(format)
  [:PDF]
end

Instance Method Details

#convert(source, target, format, opts = {}) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/libis/format/converter/office_converter.rb', line 38

def convert(source, target, format, opts = {})
  super

  return nil unless OfficeToPdf.run(source, target)

  target

end

#office_convert(_) ⇒ Object



34
35
36
# File 'lib/libis/format/converter/office_converter.rb', line 34

def office_convert(_)
  #force usage of this converter
end