class OoxmlParser::NumberFormats
Parsing ‘numFmts` tag
Attributes
@return [Array, NumberFormat] array of number formats
Public Class Methods
Source
# File lib/ooxml_parser/xlsx_parser/workbook/style_sheet/number_formats.rb, line 10 def initialize(parent: nil) @number_formats_array = [] super end
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
Public Instance Methods
Source
# File lib/ooxml_parser/xlsx_parser/workbook/style_sheet/number_formats.rb, line 37 def format_by_id(id) @number_formats_array.each do |cur_format| return cur_format if cur_format.id == id end nil end
@param id [Integer] id of format @return [NumberFormat, nil] value of format
Source
# File lib/ooxml_parser/xlsx_parser/workbook/style_sheet/number_formats.rb, line 18 def parse(node) node.attributes.each do |key, value| case key when 'count' @count = value.value.to_i end end node.xpath('*').each do |node_child| case node_child.name when 'numFmt' @number_formats_array << NumberFormat.new(parent: self).parse(node_child) end end self end
Parse NumberFormats
data @param [Nokogiri::XML:Element] node with NumberFormats
data @return [NumberFormats] value of NumberFormats
data