Class: SpreadsheetCreater

Inherits:
Object show all
Defined in:
lib/tmis/engine/import/spreadsheet_roo.rb

Class Method Summary collapse

Class Method Details

.create(filename) ⇒ Object

Contract String => Or[IsA, IsA]



129
130
131
132
133
134
135
136
# File 'lib/tmis/engine/import/spreadsheet_roo.rb', line 129

def self.create(filename)
  filename = filename.force_encoding("UTF-8")
  if filename =~ /.*.csv/
    SpreadsheetRoo.new(File.expand_path(filename))
  else
    SpreadsheetSpreadsheet.new(File.expand_path(filename))
  end
end