Sha256: ad2537aede1718cc937d8cdf3f909d44bb7e9408b9650afd27b4f4ceabcb04e4

Contents?: true

Size: 596 Bytes

Versions: 1

Compression:

Stored size: 596 Bytes

Contents

module Roo
  class Spreadsheet
    class << self
      def open(file)
        file = File === file ? file.path : file
        case File.extname(file).downcase
        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
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roo-1.11.2 lib/roo/spreadsheet.rb