Sha256: 9b281a155a550b56b5624040c0e19d460a88ab7e750c7d031d7ac4a63f2850b1

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'write_xlsx/package/xml_writer_simple'

module Writexlsx
  class Formats
    include Writexlsx::Utility

    attr_reader :formats, :xf_format_indices, :dxf_format_indices

    def initialize
      @formats = []
      @xf_format_indices = {}
      @dxf_format_indices = {}
    end

    def xf_index_by_key(key)
      @xf_format_indices[key]
    end

    def set_xf_index_by_key(key)
      @xf_format_indices[key] ||= 1 + @xf_format_indices.size
    end

    def dxf_index_by_key(key)
      @dxf_format_indices[key]
    end

    def set_dxf_index_by_key(key)
      @dxf_format_indices[key] ||= @dxf_format_indices.size
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
write_xlsx-1.09.5 lib/write_xlsx/formats.rb