blob: 20159788d82c88d441aabd954efb91d758be9d01 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
module Axlsx
# an element of style that belongs to a table style.
# @note tables and table styles are not supported in this version. This class exists in preparation for that support.
class TableStyleElement
# The type of style element. The following type are allowed
# :wholeTable
# :headerRow
# :totalRow
# :firstColumn
# :lastColumn
# :firstRowStripe
# :secondRowStripe
# :firstColumnStripe
# :secondColumnStripe
# :firstHeaderCell
# :lastHeaderCell
# :firstTotalCell
# :lastTotalCell
# :firstSubtotalColumn
# :secondSubtotalColumn
# :thirdSubtotalColumn
# :firstSubtotalRow
# :secondSubtotalRow
# :thirdSubtotalRow
# :blankRow
# :firstColumnSubheading
# :secondColumnSubheading
# :thirdColumnSubheading
# :firstRowSubheading
# :secondRowSubheading
# :thirdRowSubheading
# :pageFieldLabels
# :pageFieldValues
# @return [Symbol]
attr_reader :type
# Number of rows or columns used in striping when the type is firstRowStripe, secondRowStripe, firstColumnStripe, or secondColumnStripe.
# @return [Integer]
attr_reader :size
# The dxfId this style element points to
# @return [Integer]
attr_reader :dxfId
# creates a new TableStyleElement object
# @option options [Symbol] type
# @option options [Integer] size
# @option options [Integer] dxfId
def initialize(options={})
options.each do |o|
self.send("#{o[0]}=", o[1]) if self.respond_to? o[0]
end
end
# @see type
def type=(v) Axlsx::validate_table_element_type v; @type = v end
# @see size
def size=(v) Axlsx::validate_unsigned_int v; @size = v end
# @see dxfId
def dxfId=(v) Axlsx::validate_unsigned_int v; @dxfId = v end
# Serializes the table style element
# @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to.
# @return [String]
def to_xml(xml)
xml.tableStyleElement self.instance_values
end
end
end
|