Sha256: fa0c63e970803717f4f9d8ac4f59c6e659d6fd21a41efd84b161c183a22361d3

Contents?: true

Size: 983 Bytes

Versions: 48

Compression:

Stored size: 983 Bytes

Contents

# frozen_string_literal: true

module OoxmlParser
  # Class for parsing `border`
  class XlsxBorder < OOXMLDocumentObject
    # @return [Border] value of border
    attr_reader :left
    # @return [Border] value of border
    attr_reader :right
    # @return [Border] value of border
    attr_reader :top
    # @return [Border] value of border
    attr_reader :bottom

    # Parse XlsxBorder data
    # @param [Nokogiri::XML:Element] node with XlsxBorder data
    # @return [XlsxBorder] value of XlsxBorder data
    def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'bottom'
          @bottom = Border.new(parent: self).parse(node_child)
        when 'top'
          @top = Border.new(parent: self).parse(node_child)
        when 'right'
          @right = Border.new(parent: self).parse(node_child)
        when 'left'
          @left = Border.new(parent: self).parse(node_child)
        end
      end
      self
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
ooxml_parser-0.8.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders/xlsx_border.rb
ooxml_parser-0.8.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders/xlsx_border.rb
ooxml_parser-0.7.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders/xlsx_border.rb
ooxml_parser-0.7.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders/xlsx_border.rb
ooxml_parser-0.7.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders/xlsx_border.rb
ooxml_parser-0.6.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders/xlsx_border.rb
ooxml_parser-0.5.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders/xlsx_border.rb
ooxml_parser-0.5.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders/xlsx_border.rb