Sha256: 32117260a26228c44a5c86390c0e12a9a4b7af4fc17e7b93349cee0ec7c31189

Contents?: true

Size: 630 Bytes

Versions: 4

Compression:

Stored size: 630 Bytes

Contents

module OoxmlParser
  # Parsing `numFmt` tag
  class NumberFormat < OOXMLDocumentObject
    # @return [Integer] id of number format
    attr_accessor :id
    # @return [String] code of format
    attr_accessor :format_code

    # Parse NumberFormat data
    # @param [Nokogiri::XML:Element] node with NumberFormat data
    # @return [NumberFormat] value of NumberFormat data
    def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'numFmtId'
          @id = value.value.to_i
        when 'formatCode'
          @format_code = value.value.to_s
        end
      end
      self
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ooxml_parser-0.4.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb
ooxml_parser-0.4.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb
ooxml_parser-0.3.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb
ooxml_parser-0.2.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats/number_format.rb