class Decidim::Admin::Import::Readers::XLS

Imports any exported XLS file to local objects. It transforms the import data using the creator into the final target objects.

Constants

MIME_TYPE

Public Instance Methods

read_rows() { |to_a, index| ... } click to toggle source
# File lib/decidim/admin/import/readers/xls.rb, line 14
def read_rows
  book = ::Spreadsheet.open(file)
  sheet = book.worksheet(0)
  sheet.each_with_index do |row, index|
    yield row.to_a, index
  end
end