Class: Axlsx::Xf
- Inherits:
-
Object
- Object
- Axlsx::Xf
- Defined in:
- lib/axlsx/stylesheet/xf.rb
Overview
The Xf class defines a formatting record for use in Styles
Instance Attribute Summary collapse
-
#alignment ⇒ CellAlignment
The cell alignment for this style.
-
#applyAlignment ⇒ Boolean
Indicates if the alignment options should be applied.
-
#applyBorder ⇒ Boolean
indicates if the borderId should be applied.
-
#applyFill ⇒ Boolean
indicates if the fillId should be applied.
-
#applyFont ⇒ Boolean
indicates if the fontId should be applied.
-
#applyNumberFormat ⇒ Boolean
indicates if the numFmtId should be applied.
-
#applyProtection ⇒ Boolean
Indicates if the protection options should be applied.
-
#borderId ⇒ Integer
index (0 based) of the border to be used in this style.
-
#fillId ⇒ Integer
index (0 based) of the fill to be used in this style.
-
#fontId ⇒ Integer
index (0 based) of the font to be used in this style.
-
#numFmtId ⇒ Integer
id of the numFmt to apply to this style.
-
#pivotButton ⇒ Boolean
indicates if the cell has a pivot table drop down button.
-
#protection ⇒ CellProtection
The cell protection for this style.
-
#quotePrefix ⇒ Boolean
indecates if text should be prefixed by a single quote in the cell.
-
#xfId ⇒ Integer
index (0 based) of cellStylesXfs item to be used in this style.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Xf
constructor
Creates a new Xf object.
-
#to_xml(xml) ⇒ String
Serializes the xf elemen.
Constructor Details
#initialize(options = {}) ⇒ Xf
Creates a new Xf object
84 85 86 87 88 |
# File 'lib/axlsx/stylesheet/xf.rb', line 84 def initialize(={}) .each do |o| self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" end end |
Instance Attribute Details
#alignment ⇒ CellAlignment
The cell alignment for this style
9 10 11 |
# File 'lib/axlsx/stylesheet/xf.rb', line 9 def alignment @alignment end |
#applyAlignment ⇒ Boolean
Indicates if the alignment options should be applied
62 63 64 |
# File 'lib/axlsx/stylesheet/xf.rb', line 62 def applyAlignment @applyAlignment end |
#applyBorder ⇒ Boolean
indicates if the borderId should be applied
58 59 60 |
# File 'lib/axlsx/stylesheet/xf.rb', line 58 def applyBorder @applyBorder end |
#applyFill ⇒ Boolean
indicates if the fillId should be applied
54 55 56 |
# File 'lib/axlsx/stylesheet/xf.rb', line 54 def applyFill @applyFill end |
#applyFont ⇒ Boolean
indicates if the fontId should be applied
50 51 52 |
# File 'lib/axlsx/stylesheet/xf.rb', line 50 def applyFont @applyFont end |
#applyNumberFormat ⇒ Boolean
indicates if the numFmtId should be applied
46 47 48 |
# File 'lib/axlsx/stylesheet/xf.rb', line 46 def applyNumberFormat @applyNumberFormat end |
#applyProtection ⇒ Boolean
Indicates if the protection options should be applied
66 67 68 |
# File 'lib/axlsx/stylesheet/xf.rb', line 66 def applyProtection @applyProtection end |
#borderId ⇒ Integer
index (0 based) of the border to be used in this style
30 31 32 |
# File 'lib/axlsx/stylesheet/xf.rb', line 30 def borderId @borderId end |
#fillId ⇒ Integer
index (0 based) of the fill to be used in this style
26 27 28 |
# File 'lib/axlsx/stylesheet/xf.rb', line 26 def fillId @fillId end |
#fontId ⇒ Integer
index (0 based) of the font to be used in this style
22 23 24 |
# File 'lib/axlsx/stylesheet/xf.rb', line 22 def fontId @fontId end |
#numFmtId ⇒ Integer
id of the numFmt to apply to this style
18 19 20 |
# File 'lib/axlsx/stylesheet/xf.rb', line 18 def numFmtId @numFmtId end |
#pivotButton ⇒ Boolean
indicates if the cell has a pivot table drop down button
42 43 44 |
# File 'lib/axlsx/stylesheet/xf.rb', line 42 def pivotButton @pivotButton end |
#protection ⇒ CellProtection
The cell protection for this style
14 15 16 |
# File 'lib/axlsx/stylesheet/xf.rb', line 14 def protection @protection end |
#quotePrefix ⇒ Boolean
indecates if text should be prefixed by a single quote in the cell
38 39 40 |
# File 'lib/axlsx/stylesheet/xf.rb', line 38 def quotePrefix @quotePrefix end |
#xfId ⇒ Integer
index (0 based) of cellStylesXfs item to be used in this style. Only applies to cellXfs items
34 35 36 |
# File 'lib/axlsx/stylesheet/xf.rb', line 34 def xfId @xfId end |
Instance Method Details
#to_xml(xml) ⇒ String
Serializes the xf elemen
110 111 112 113 114 115 |
# File 'lib/axlsx/stylesheet/xf.rb', line 110 def to_xml(xml) xml.xf(self.instance_values.reject { |k, v| [:alignment, :protection, :extList, :name].include? k.to_sym}) { alignment.to_xml(xml) if self.alignment protection.to_xml(xml) if self.protection } end |