Class: OoxmlParser::TableLook

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

Overview

Describe look of table, parsed ‘w:tblLook`

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(parent: nil) ⇒ TableLook

Returns a new instance of TableLook.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb', line 9

def initialize(parent: nil)
  @first_row = false
  @first_column = false
  @last_row = false
  @last_column = false
  @banding_row = false
  @banding_column = false
  @no_horizontal_banding = false
  @no_horizontal_banding = false
  super
end

Instance Attribute Details

#banding_columnObject

Returns the value of attribute banding_column.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb', line 6

def banding_column
  @banding_column
end

#banding_rowObject

Returns the value of attribute banding_row.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb', line 6

def banding_row
  @banding_row
end

#first_columnObject

Returns the value of attribute first_column.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb', line 6

def first_column
  @first_column
end

#first_rowObject

Returns the value of attribute first_row.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb', line 6

def first_row
  @first_row
end

#last_columnObject

Returns the value of attribute last_column.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb', line 6

def last_column
  @last_column
end

#last_rowObject

Returns the value of attribute last_row.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb', line 6

def last_row
  @last_row
end

#no_horizontal_bandingObject

Returns the value of attribute no_horizontal_banding.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb', line 6

def no_horizontal_banding
  @no_horizontal_banding
end

#no_vertical_bandingObject

Returns the value of attribute no_vertical_banding.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb', line 6

def no_vertical_banding
  @no_vertical_banding
end

Instance Method Details

#parse(node) ⇒ TableLook

Parse TableLook object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb', line 24

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'firstRow'
      @first_row = attribute_enabled?(value)
    when 'lastRow'
      @last_row = attribute_enabled?(value)
    when 'firstCol', 'firstColumn'
      @first_column = attribute_enabled?(value)
    when 'lastCol', 'lastColumn'
      @last_column = attribute_enabled?(value)
    when 'noHBand'
      @no_horizontal_banding = attribute_enabled?(value)
    when 'noVBand'
      @no_vertical_banding = attribute_enabled?(value)
    when 'bandRow'
      @banding_row = attribute_enabled?(value)
    when 'bandCol'
      @banding_column = attribute_enabled?(value)
    end
  end
  self
end