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

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

#initialize(parent: nil) ⇒ TableLook

Returns a new instance of TableLook.



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

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
  @parent = parent
end

Instance Attribute Details

#banding_columnObject

Returns the value of attribute banding_column.



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

def banding_column
  @banding_column
end

#banding_rowObject

Returns the value of attribute banding_row.



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

def banding_row
  @banding_row
end

#first_columnObject

Returns the value of attribute first_column.



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

def first_column
  @first_column
end

#first_rowObject

Returns the value of attribute first_row.



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

def first_row
  @first_row
end

#last_columnObject

Returns the value of attribute last_column.



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

def last_column
  @last_column
end

#last_rowObject

Returns the value of attribute last_row.



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

def last_row
  @last_row
end

#no_horizontal_bandingObject

Returns the value of attribute no_horizontal_banding.



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

def no_horizontal_banding
  @no_horizontal_banding
end

#no_vertical_bandingObject

Returns the value of attribute no_vertical_banding.



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

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:



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

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