Class: Roo::Spreadsheet
- Inherits:
-
Object
- Object
- Roo::Spreadsheet
- Defined in:
- lib/roo.rb
Class Method Summary collapse
Class Method Details
.open(file) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/roo.rb', line 7 def open(file) file = File === file ? file.path : file case File.extname(file) when '.xls' Roo::Excel.new(file) when '.xlsx' Roo::Excelx.new(file) when '.ods' Roo::Openoffice.new(file) when '.xml' Roo::Excel2003XML.new(file) when '' Roo::Google.new(file) when '.csv' Roo::Csv.new(file) else raise ArgumentError, "Don't know how to open file #{file}" end end |