Class: Xlsxtream::SharedStringTable

Inherits:
Hash
  • Object
show all
Defined in:
lib/xlsxtream/shared_string_table.rb

Instance Method Summary collapse

Constructor Details

#initializeSharedStringTable

Returns a new instance of SharedStringTable.



3
4
5
6
# File 'lib/xlsxtream/shared_string_table.rb', line 3

def initialize
  @references = 0
  super { |hash, string| hash[string] = hash.size }
end

Instance Method Details

#[](string) ⇒ Object



8
9
10
11
# File 'lib/xlsxtream/shared_string_table.rb', line 8

def [](string)
  @references += 1
  super
end

#referencesObject



13
14
15
# File 'lib/xlsxtream/shared_string_table.rb', line 13

def references
  @references
end