Class: Roo::Excelx::Shared

Inherits:
Object
  • Object
show all
Defined in:
lib/roo/excelx/shared.rb

Overview

Public: Shared class for allowing sheets to share data. This should

reduce memory usage and reduce the number of objects being passed
to various inititializers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir, options = {}) ⇒ Shared

Returns a new instance of Shared.



8
9
10
11
12
13
14
15
16
# File 'lib/roo/excelx/shared.rb', line 8

def initialize(dir, options = {})
  @dir = dir
  @comments_files = []
  @sheet_files = []
  @rels_files = []
  @options = options
  @image_rels = []
  @image_files = []
end

Instance Attribute Details

#comments_filesObject

Returns the value of attribute comments_files.



7
8
9
# File 'lib/roo/excelx/shared.rb', line 7

def comments_files
  @comments_files
end

#image_filesObject

Returns the value of attribute image_files.



7
8
9
# File 'lib/roo/excelx/shared.rb', line 7

def image_files
  @image_files
end

#image_relsObject

Returns the value of attribute image_rels.



7
8
9
# File 'lib/roo/excelx/shared.rb', line 7

def image_rels
  @image_rels
end

#rels_filesObject

Returns the value of attribute rels_files.



7
8
9
# File 'lib/roo/excelx/shared.rb', line 7

def rels_files
  @rels_files
end

#sheet_filesObject

Returns the value of attribute sheet_files.



7
8
9
# File 'lib/roo/excelx/shared.rb', line 7

def sheet_files
  @sheet_files
end

Instance Method Details

#base_dateObject



30
31
32
# File 'lib/roo/excelx/shared.rb', line 30

def base_date
  workbook.base_date
end

#base_timestampObject



34
35
36
# File 'lib/roo/excelx/shared.rb', line 34

def base_timestamp
  workbook.base_timestamp
end

#shared_stringsObject



22
23
24
# File 'lib/roo/excelx/shared.rb', line 22

def shared_strings
  @shared_strings ||= SharedStrings.new(File.join(@dir, 'roo_sharedStrings.xml'), @options)
end

#stylesObject



18
19
20
# File 'lib/roo/excelx/shared.rb', line 18

def styles
  @styles ||= Styles.new(File.join(@dir, 'roo_styles.xml'))
end

#workbookObject



26
27
28
# File 'lib/roo/excelx/shared.rb', line 26

def workbook
  @workbook ||= Workbook.new(File.join(@dir, 'roo_workbook.xml'))
end