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) ⇒ Shared

Returns a new instance of Shared.



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

def initialize(dir)
  @dir = dir
  @comments_files = []
  @sheet_files = []
  @rels_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

#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



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

def base_date
  workbook.base_date
end

#shared_stringsObject



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

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

#stylesObject



15
16
17
# File 'lib/roo/excelx/shared.rb', line 15

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

#workbookObject



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

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