Class: Decidim::Admin::Import::Readers::XLSX
- Defined in:
- lib/decidim/admin/import/readers/xlsx.rb
Overview
Imports any exported XLSX file to local objects. It transforms the import data using the creator into the final target objects.
Constant Summary collapse
- MIME_TYPE =
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Decidim::Admin::Import::Readers::Base
Instance Method Details
#read_rows ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/decidim/admin/import/readers/xlsx.rb', line 14 def read_rows workbook = RubyXL::Parser.parse(file) sheet = workbook.worksheets[0] sheet.each_with_index do |row, index| yield row.cells.map(&:value), index end end |