class OoxmlParser::XlsxBorders

Class for parsing ‘borders`

Attributes

borders_array[R]

@return [Array<XlsxBorder>] list of xlsx borders

count[R]

@return [Integer] count of xlsx borders

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/xlsx_borders.rb, line 12
def initialize(parent: nil)
  @borders_array = []
  super
end

Public Instance Methods

parse(node) click to toggle source

Parse XlsxBorders data @param [Nokogiri::XML:Element] node with XlsxBorders data @return [XlsxBorders] value of XlsxBorders data

# 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