Sha256: 68be3fdb30512b38aa532d6d68283c300eab5d1ca397e5f7343005c86d0c2ae7

Contents?: true

Size: 391 Bytes

Versions: 6

Compression:

Stored size: 391 Bytes

Contents

require 'colander/invalid_file'
require 'colander/parser/xls'
require 'colander/parser/xlsx'

module Colander
  def self.parse(file_path, file_name = nil)
    parser = case (file_name || file_path).split(".").last
    when "xls"
      Parser::Xls.new(file_path)
    when "xlsx"
      Parser::Xlsx.new(file_path)
    else
      raise InvalidFile
    end
    parser.parse
    parser
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
colander-0.1.2 lib/colander.rb
colander-0.1.1 lib/colander.rb
colander-0.1.0 lib/colander.rb
colander-0.0.3 lib/colander.rb
colander-0.0.2 lib/colander.rb
colander-0.0.1 lib/colander.rb