Method: I18nGenerator::ExcelParser#parse
- Defined in:
- lib/i18n_generator/excel_parser.rb
#parse ⇒ Object
Parses the spreadsheet to a list of Labels
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/i18n_generator/excel_parser.rb', line 42 def parse labels = [].tap do |labels_array| params_hash = {} FIRST_DATA_ROW_NUMBER.upto @excel_data.last_row do |row_num| params_hash[:id] = @excel_data.cell(row_num, LABEL_ID_COLUMN_INDEX) params_hash[:description] = @excel_data.cell(row_num, LABEL_DESCRIPTION_COLUMN_INDEX) FIRST_TRANSLATION_COLUMN.upto @excel_data.last_column do |col_num| params_hash[@excel_data.cell(FIRST_DATA_ROW_NUMBER-1, col_num).to_sym] = @excel_data.cell(row_num, col_num) end labels_array << Label.new(params_hash) end end end |