Class: SysMODB::Extractor

Inherits:
Object
  • Object
show all
Defined in:
lib/sysmodb/extractor.rb

Overview

handles the delegation to java

Constant Summary collapse

JAR_VERSION =
'0.18.1'.freeze
DEFAULT_PATH =
File.dirname(__FILE__) + "/../../jars/simple-spreadsheet-extractor-#{JAR_VERSION}.jar"

Instance Method Summary collapse

Constructor Details

#initialize(memory_allocation) ⇒ Extractor

Returns a new instance of Extractor.

Raises:

  • (Exception)


12
13
14
15
# File 'lib/sysmodb/extractor.rb', line 12

def initialize(memory_allocation)
  @memory_allocation = memory_allocation
  raise Exception, 'Windows is not currently supported' if is_windows?
end

Instance Method Details

#spreadsheet_to_csv(spreadsheet_data, sheet = 1, trim = false) ⇒ Object

spreadsheet_data can be an IO like object or the path to a file



23
24
25
# File 'lib/sysmodb/extractor.rb', line 23

def spreadsheet_to_csv(spreadsheet_data, sheet = 1, trim = false)
  spreadsheet_to_requested_format(spreadsheet_data, 'csv', sheet, trim)
end

#spreadsheet_to_xml(spreadsheet_data) ⇒ Object

spreadsheet_data can be an IO like object or the path to a file



18
19
20
# File 'lib/sysmodb/extractor.rb', line 18

def spreadsheet_to_xml(spreadsheet_data)
  spreadsheet_to_requested_format(spreadsheet_data, 'xml')
end