Method: Roo::Spreadsheet.open
- Defined in:
- lib/roo/spreadsheet.rb
.open(path, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/roo/spreadsheet.rb', line 6 def open(path, = {}) path = path.respond_to?(:path) ? path.path : path extension = extension_for(path, ) begin Roo::CLASS_FOR_EXTENSION.fetch(extension).new(path, ) rescue KeyError raise ArgumentError, "Can't detect the type of #{path} - please use the :extension option to declare its type." end end |