Class: Xlsxtream::SharedStringTable
- Inherits:
-
Hash
- Object
- Hash
- Xlsxtream::SharedStringTable
- Defined in:
- lib/xlsxtream/shared_string_table.rb
Instance Method Summary collapse
- #[](string) ⇒ Object
-
#initialize ⇒ SharedStringTable
constructor
A new instance of SharedStringTable.
- #references ⇒ Object
Constructor Details
#initialize ⇒ SharedStringTable
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 |
#references ⇒ Object
13 14 15 |
# File 'lib/xlsxtream/shared_string_table.rb', line 13 def references @references end |