Class: CsvImportAnalyzer::Analyzer::FileTypeAssertion

Inherits:
Object
  • Object
show all
Defined in:
lib/csv-import-analyzer/analyzer/file_type_assertion.rb

Instance Method Summary collapse

Instance Method Details

#check_file_type(filename) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/csv-import-analyzer/analyzer/file_type_assertion.rb', line 6

def check_file_type(filename)
  extension = File.absolute_path(filename).split(".").last
  if extension == "csv"
    Analyzer::FileTypeAssertion.new("sampleTab.csv")
  #Try adding support for non csv files - xlsx, xls in future
  elsif extension == "xlsx"
    puts "xlsx"
  else
    # return UnsupportedFileFormat.new
  end
end

#convert_excel_to_csvObject



18
19
20
# File 'lib/csv-import-analyzer/analyzer/file_type_assertion.rb', line 18

def convert_excel_to_csv

end