Class: Libis::Format::Converter::SpreadsheetConverter

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

Instance Attribute Summary

Attributes inherited from Base

#flags, #options

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_typesObject



14
15
16
17
18
19
20
# File 'lib/libis/format/converter/spreadsheet_converter.rb', line 14

def self.input_types
  [
      :MSXLS,
      :MSXLSX,
      :OO_CALC
  ]
end

.output_types(format = nil) ⇒ Object



22
23
24
25
# File 'lib/libis/format/converter/spreadsheet_converter.rb', line 22

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

Instance Method Details

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



31
32
33
34
35
36
37
38
# File 'lib/libis/format/converter/spreadsheet_converter.rb', line 31

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

  return nil unless Format::Tool::SpreadsheetToOds.run(source, target)

  target

end

#spreadsheet_convert(_) ⇒ Object



27
28
29
# File 'lib/libis/format/converter/spreadsheet_converter.rb', line 27

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