Class: OoxmlParser::TableBorders

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb

Overview

Class for describing Table Border Propertie

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#bottomBordersProperties

Returns bottom border property.

Returns:



13
14
15
# File 'lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb', line 13

def bottom
  @bottom
end

#inside_horizontalBordersProperties

Returns inside horizontal property.

Returns:



17
18
19
# File 'lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb', line 17

def inside_horizontal
  @inside_horizontal
end

#inside_verticalBordersProperties

Returns inside vertical property.

Returns:



15
16
17
# File 'lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb', line 15

def inside_vertical
  @inside_vertical
end

#leftBordersProperties

Returns left border property.

Returns:



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb', line 7

def left
  @left
end

#rightBordersProperties

Returns right border property.

Returns:



9
10
11
# File 'lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb', line 9

def right
  @right
end

#topBordersProperties

Returns top border property.

Returns:



11
12
13
# File 'lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb', line 11

def top
  @top
end

Instance Method Details

#parse(node) ⇒ TableBorders

Parse Table Borders data

Parameters:

  • node (Nokogiri::XML:Element)

    with Table Borders data

Returns:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ooxml_parser/common_parser/common_data/table/table_properties/table_borders.rb', line 22

def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'left'
      @left = BordersProperties.new(parent: self).parse(node_child)
    when 'top'
      @top = BordersProperties.new(parent: self).parse(node_child)
    when 'right'
      @right = BordersProperties.new(parent: self).parse(node_child)
    when 'bottom'
      @bottom = BordersProperties.new(parent: self).parse(node_child)
    when 'insideV'
      @inside_vertical = BordersProperties.new(parent: self).parse(node_child)
    when 'insideH'
      @inside_horizontal = BordersProperties.new(parent: self).parse(node_child)
    end
  end
  self
end