Method: Libis::Tools::Spreadsheet#parse

Defined in:
lib/libis/tools/spreadsheet.rb

#parse(options = {}) ⇒ Array<Hash>

Parse sheet content.

The options Hash can contain the following keys:

  • :sheet - overwrites default sheet name

  • :required - Array or Hash of required headers

  • :optional - Array or Hash of optional headers

  • :noheader - Array of noheader headers

An Array will be returned with for each row a Hash with the key names as specified in the header options and the corresponding cell values.

Parameters:

  • options (Hash) (defaults to: {})

Returns:



95
96
97
98
# File 'lib/libis/tools/spreadsheet.rb', line 95

def parse(options = {})
  @ss.default_sheet = options.delete(:sheet) if options.has_key?(:sheet)
  @ss.parse(check_headers(options))
end