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.



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

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

Instance Method Details

#[](string) ⇒ Object



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

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

#referencesObject



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

def references
  @references
end