Class: OoxmlParser::TableCellLine

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb

Overview

Class for parsing Table Cell Lines

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

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

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

#initialize(fill = nil, line_join = nil, parent: nil) ⇒ TableCellLine

Returns a new instance of TableCellLine.



9
10
11
12
13
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb', line 9

def initialize(fill = nil, line_join = nil, parent: nil)
  @fill = fill
  @line_join = line_join
  super(parent: parent)
end

Instance Attribute Details

#alignObject

Returns the value of attribute align.



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb', line 7

def align
  @align
end

#cap_typeObject

Returns the value of attribute cap_type.



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb', line 7

def cap_type
  @cap_type
end

#compound_line_typeObject

Returns the value of attribute compound_line_type.



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb', line 7

def compound_line_type
  @compound_line_type
end

#dashObject

Returns the value of attribute dash.



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb', line 7

def dash
  @dash
end

#fillObject

Returns the value of attribute fill.



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb', line 7

def fill
  @fill
end

#head_endObject

Returns the value of attribute head_end.



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb', line 7

def head_end
  @head_end
end

#line_joinObject

Returns the value of attribute line_join.



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb', line 7

def line_join
  @line_join
end

#tail_endObject

Returns the value of attribute tail_end.



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb', line 7

def tail_end
  @tail_end
end

#widthObject

Returns the value of attribute width.



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb', line 7

def width
  @width
end

Instance Method Details

#parse(node) ⇒ TableCellLine

Parse TableCellLine object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb', line 18

def parse(node)
  @fill = PresentationFill.new(parent: self).parse(node)
  @line_join = LineJoin.new(parent: self).parse(node)
  node.attributes.each do |key, value|
    case key
    when 'w'
      @width = OoxmlSize.new(value.value.to_f, :emu)
    when 'algn'
      @align = value_to_symbol(value)
    end
  end

  node.xpath('*').each do |node_child|
    case node_child.name
    when 'headEnd'
      @head_end = LineEnd.new(parent: self).parse(node_child)
    when 'tailEnd'
      @tail_end = LineEnd.new(parent: self).parse(node_child)
    when 'ln'
      return TableCellLine.new(parent: self).parse(node_child)
    end
  end
  self
end