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



7
8
9
# File 'lib/parxer/parsers/xls_parser.rb', line 7

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

#raw_rowsObject



3
4
5
# File 'lib/parxer/parsers/xls_parser.rb', line 3

def raw_rows
  worksheet
end

#workbookObject



15
16
17
# File 'lib/parxer/parsers/xls_parser.rb', line 15

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

#worksheetObject



11
12
13
# File 'lib/parxer/parsers/xls_parser.rb', line 11

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