Class: OoxmlParser::CellXfs
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::CellXfs
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs.rb
Overview
Class for parsing ‘cellXfs`
Instance Attribute Summary collapse
-
#count ⇒ Integer
readonly
Count of cell xfs.
-
#xf_array ⇒ Array<Xf>
readonly
List of xf’s.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ CellXfs
constructor
A new instance of CellXfs.
-
#parse(node) ⇒ CellXfs
Parse CellXfs 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) ⇒ CellXfs
Returns a new instance of CellXfs.
12 13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs.rb', line 12 def initialize(parent: nil) @xf_array = [] super end |
Instance Attribute Details
#count ⇒ Integer (readonly)
Returns count of cell xfs.
8 9 10 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs.rb', line 8 def count @count end |
#xf_array ⇒ Array<Xf> (readonly)
Returns list of xf’s.
10 11 12 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs.rb', line 10 def xf_array @xf_array end |
Instance Method Details
#parse(node) ⇒ CellXfs
Parse CellXfs data
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs.rb', line 20 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 'xf' @xf_array << Xf.new(parent: self).parse(node_child) end end self end |