class OoxmlParser::DifferentialFormattingRecords
Parsing ‘dxfs` tag
Attributes
count[R]
@return [Integer] count of formats
differential_formatting_records[R]
@return [Array, DifferentialFormattingRecord] list of formatting records
Public Class Methods
new(parent: nil)
click to toggle source
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
# File lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb, line 11 def initialize(parent: nil) @differential_formatting_records = [] super end
Public Instance Methods
[](key)
click to toggle source
@return [Array, DifferentialFormattingRecord] accessor
# File lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb, line 17 def [](key) @differential_formatting_records[key] end
parse(node)
click to toggle source
Parse DifferentialFormattingRecords
data @param [Nokogiri::XML:Element] node with DifferentialFormattingRecords
data @return [DifferentialFormattingRecords] value of DifferentialFormattingRecords
data
# File lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb, line 24 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 'dxf' @differential_formatting_records << DifferentialFormattingRecord.new(parent: self).parse(node_child) end end self end