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.
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 |
#references ⇒ Object
14 15 16 |
# File 'lib/xlsxtream/shared_string_table.rb', line 14 def references @references end |