Class: Roo::Spreadsheet

Inherits:
Object
  • Object
show all
Defined in:
lib/roo.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) open(file)



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/roo.rb', line 4

def open(file)
  case File.extname(file)
  when '.xls'
    Excel.new(file)
  when '.xlsx'
    Excelx.new(file)
  when '.ods'
    Openoffice.new(file)
  when '.xml'
    Excel2003XML.new(file)
  when ''
    Google.new(file)
  else
    raise ArgumentError, "Don't know how to open file #{file}"
  end      
end