class OoxmlParser::Fonts
Parsing `fonts` tag
Attributes
fonts_array[RW]
@return [Array, Font] array of number formats
Public Class Methods
new(parent: nil)
click to toggle source
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
# File lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb, line 10 def initialize(parent: nil) @fonts_array = [] super end
Public Instance Methods
[](key)
click to toggle source
@return [Array<Font>] accessor
# File lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb, line 16 def [](key) @fonts_array[key] end
parse(node)
click to toggle source
Parse Fonts
data @param [Nokogiri::XML:Element] node with NumberFormats
data @return [Fonts] value of NumberFormats
data
# File lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb, line 23 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 'font' @fonts_array << Font.new(parent: self).parse(node_child) end end self end