Class: Parxer::XlsParser

Inherits:
BaseParser show all
Defined in:
lib/parxer/parsers/xls_parser.rb

Instance Attribute Summary

Attributes inherited from BaseParser

#attribute, #file, #prev_row, #row, #value

Instance Method Summary collapse

Methods inherited from BaseParser

#file_extension, #header, #rows_count, #run

Methods included from InheritedResource

#for_each_ancestor_with_method, #inherited_collection, #inherited_hash, #object_ancestors

Instance Method Details

#extract_raw_attr_value(value) ⇒ Object



9
10
11
# File 'lib/parxer/parsers/xls_parser.rb', line 9

def extract_raw_attr_value(value)
  value.is_a?(Spreadsheet::Formula) ? value.value : value
end

#raw_rowsObject



5
6
7
# File 'lib/parxer/parsers/xls_parser.rb', line 5

def raw_rows
  worksheet
end

#workbookObject



17
18
19
# File 'lib/parxer/parsers/xls_parser.rb', line 17

def workbook
  @workbook ||= Roo::Spreadsheet.open(file, parser_config)
end

#worksheetObject



13
14
15
# File 'lib/parxer/parsers/xls_parser.rb', line 13

def worksheet
  @worksheet ||= workbook.sheet(0)
end