Method: Libis::Tools::Spreadsheet#each

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

#each(options = {}, &block) ⇒ Object

Iterate over 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

Each iteration, a Hash will be passed with the key names as specified in the header options and the corresponding cell values.

Parameters:

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


77
78
79
80
# File 'lib/libis/tools/spreadsheet.rb', line 77

def each(options = {}, &block)
  @ss.default_sheet = options[:sheet] if options[:sheet]
  @ss.each(check_headers(options), &block)
end