class RubyXL::SharedStringsTable
def [](index)
def [](index) strings[index] end
def add(str, index = nil)
def add(str, index = nil) index ||= strings.size strings[index] = RubyXL::Text.new(:value => str) @index_by_content[str] = index end
def before_write_xml
def before_write_xml super self.unique_count = self.count self.count > 0 end
def empty?
def empty? strings.empty? end
def get_index(str, add_if_missing = false)
def get_index(str, add_if_missing = false) index = @index_by_content[str] index = add(str) if index.nil? && add_if_missing index end
def initialize(*params)
def initialize(*params) super # So far, going by the structure that the original creator had in mind. However, # since the actual implementation is now extracted into a separate class, # we will be able to transparrently change it later if needs be. @index_by_content = {} end
def xlsx_path
def xlsx_path ROOT.join('xl', 'sharedStrings.xml') end