Class: SymbolsParser

Inherits:
Base
  • Object
show all
Defined in:
lib/parser/symbols_parser.rb

Instance Method Summary collapse

Methods inherited from Base

get_sheet_name, #initialize, #reload_sheet, sheet_name, #to_json

Constructor Details

This class inherits a constructor from Base

Instance Method Details

#parse_sheetObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/parser/symbols_parser.rb', line 4

def parse_sheet
  result = @sheet.to_matrix(2, 1, nil, 3).to_a.inject({}) do |result, arr|
    result[arr[1]] = {
      index: arr[0],
      name: arr[2],
      type: arr[2].include?("WD") ? 'wild' : nil
    }.compact
    result
  end
end