Class: OoxmlParser::XlsxBorders
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::XlsxBorders
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/style_sheet/xlsx_borders.rb
Overview
Class for parsing ‘borders`
Instance Attribute Summary collapse
-
#borders_array ⇒ Array<XlsxBorder>
readonly
List of xlsx borders.
-
#count ⇒ Integer
readonly
Count of xlsx borders.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ XlsxBorders
constructor
A new instance of XlsxBorders.
-
#parse(node) ⇒ XlsxBorders
Parse XlsxBorders 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) ⇒ XlsxBorders
Returns a new instance of XlsxBorders.
12 13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/xlsx_borders.rb', line 12 def initialize(parent: nil) @borders_array = [] super end |
Instance Attribute Details
#borders_array ⇒ Array<XlsxBorder> (readonly)
Returns list of xlsx borders.
10 11 12 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/xlsx_borders.rb', line 10 def borders_array @borders_array end |
#count ⇒ Integer (readonly)
Returns count of xlsx borders.
8 9 10 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/xlsx_borders.rb', line 8 def count @count end |
Instance Method Details
#parse(node) ⇒ XlsxBorders
Parse XlsxBorders 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/xlsx_borders.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 'border' @borders_array << XlsxBorder.new(parent: self).parse(node_child) end end self end |