Class: ExcelxReader

Inherits:
SpreadsheetReader show all
Includes:
RooModule
Defined in:
lib/simple-spreadsheet/readers/excelx_reader.rb

Instance Method Summary collapse

Methods included from RooModule

#cell, #celltype, #first_column, #first_row, #last_column, #last_row, #selected_sheet=, #sheets

Methods inherited from SpreadsheetReader

#cell, #celltype, #first_column, #first_row, #last_column, #last_row, #parse, #selected_sheet=, #sheets

Methods inherited from GenericSheet

#path

Constructor Details

#initialize(file) ⇒ ExcelxReader

Returns a new instance of ExcelxReader.


3
4
5
6
# File 'lib/simple-spreadsheet/readers/excelx_reader.rb', line 3

def initialize(file)
  super
  @engine = ExcelxExtended.new(file) # Roo
end

Instance Method Details

#excelx_value(row, col, sheet = nil) ⇒ Object


12
13
14
15
16
17
18
19
# File 'lib/simple-spreadsheet/readers/excelx_reader.rb', line 12

def excelx_value(row, col, sheet=nil)
  sheet = @engine.default_sheet if sheet.nil?
  if sheet.is_a? Integer
    @engine.excelx_value(row, col, @engine.sheets[sheet - 1])
  else
    @engine.excelx_value(row, col, sheet)
  end
end

#foreach(sheet, &block) ⇒ Object


8
9
10
# File 'lib/simple-spreadsheet/readers/excelx_reader.rb', line 8

def foreach(sheet, &block)
  @engine.foreach(sheet, &block)
end