Class: OoxmlParser::DifferentialFormattingRecords
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::DifferentialFormattingRecords
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb
Overview
Parsing ‘dxfs` tag
Instance Attribute Summary collapse
-
#count ⇒ Integer
readonly
Count of formats.
-
#differential_formatting_records ⇒ Array, DifferentialFormattingRecord
readonly
List of formatting records.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#[](key) ⇒ Array, DifferentialFormattingRecord
Accessor.
-
#initialize(parent: nil) ⇒ DifferentialFormattingRecords
constructor
A new instance of DifferentialFormattingRecords.
-
#parse(node) ⇒ DifferentialFormattingRecords
Parse DifferentialFormattingRecords data.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ DifferentialFormattingRecords
Returns a new instance of DifferentialFormattingRecords.
11 12 13 14 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb', line 11 def initialize(parent: nil) @differential_formatting_records = [] super end |
Instance Attribute Details
#count ⇒ Integer (readonly)
Returns count of formats.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb', line 9 def count @count end |
#differential_formatting_records ⇒ Array, DifferentialFormattingRecord (readonly)
Returns list of formatting records.
7 8 9 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb', line 7 def differential_formatting_records @differential_formatting_records end |
Instance Method Details
#[](key) ⇒ Array, DifferentialFormattingRecord
Returns accessor.
17 18 19 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/differential_formatting_records.rb', line 17 def [](key) @differential_formatting_records[key] end |
#parse(node) ⇒ DifferentialFormattingRecords
Parse DifferentialFormattingRecords data
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# 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 |