class OoxmlParser::StyleSheet
Parsing file styles.xml
Attributes
@return [XlsxBorders] Cell XFs
@return [CellXfs] Cell XFs
@return [DifferentialFormattingRecords] list of differential formatting records
@return [Fills] fills
@return [Fonts] fonts
@return [NumberFormats] number formats
Public Class Methods
Source
# File lib/ooxml_parser/xlsx_parser/workbook/style_sheet.rb, line 25 def initialize(parent: nil) @number_formats = NumberFormats.new(parent: self) @fonts = Fonts.new(parent: self) @fills = Fills.new(parent: self) super end
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
Public Instance Methods
Source
# File lib/ooxml_parser/xlsx_parser/workbook/style_sheet.rb, line 34 def parse doc = parse_xml("#{root_object.unpacked_folder}/#{root_object.root_subfolder}/styles.xml") doc.root.xpath('*').each do |node_child| case node_child.name when 'numFmts' @number_formats.parse(node_child) when 'fonts' @fonts.parse(node_child) when 'fills' @fills.parse(node_child) when 'cellXfs' @cell_xfs = CellXfs.new(parent: self).parse(node_child) when 'borders' @borders = XlsxBorders.new(parent: self).parse(node_child) when 'dxfs' @differential_formatting_records = DifferentialFormattingRecords.new(parent: self).parse(node_child) end end self end
Parse StyleSheet
object @return [StyleSheet] result of parsing