Class: Axlsx::Xf
- Inherits:
-
Object
- Object
- Axlsx::Xf
- Includes:
- OptionsParser, SerializedAttributes
- Defined in:
- lib/axlsx/stylesheet/xf.rb
Overview
The Xf class defines a formatting record for use in Styles. The recommended way to manage styles for your workbook is with Styles#add_style
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_string(str = '') ⇒ String
Serializes the object.
Methods included from OptionsParser
Methods included from SerializedAttributes
#declared_attributes, included, #serialized_attributes, #serialized_element_attributes, #serialized_tag
Constructor Details
#initialize(options = {}) ⇒ Xf
Creates a new Xf object
25 26 27 |
# File 'lib/axlsx/stylesheet/xf.rb', line 25 def initialize( = {}) end |
Instance Attribute Details
#alignment ⇒ CellAlignment
The cell alignment for this style
36 37 38 |
# File 'lib/axlsx/stylesheet/xf.rb', line 36 def alignment @alignment end |
#applyAlignment ⇒ Boolean
Indicates if the alignment options should be applied
89 90 91 |
# File 'lib/axlsx/stylesheet/xf.rb', line 89 def applyAlignment @applyAlignment end |
#applyBorder ⇒ Boolean
indicates if the borderId should be applied
85 86 87 |
# File 'lib/axlsx/stylesheet/xf.rb', line 85 def applyBorder @applyBorder end |
#applyFill ⇒ Boolean
indicates if the fillId should be applied
81 82 83 |
# File 'lib/axlsx/stylesheet/xf.rb', line 81 def applyFill @applyFill end |
#applyFont ⇒ Boolean
indicates if the fontId should be applied
77 78 79 |
# File 'lib/axlsx/stylesheet/xf.rb', line 77 def applyFont @applyFont end |
#applyNumberFormat ⇒ Boolean
indicates if the numFmtId should be applied
73 74 75 |
# File 'lib/axlsx/stylesheet/xf.rb', line 73 def applyNumberFormat @applyNumberFormat end |
#applyProtection ⇒ Boolean
Indicates if the protection options should be applied
93 94 95 |
# File 'lib/axlsx/stylesheet/xf.rb', line 93 def applyProtection @applyProtection end |
#borderId ⇒ Integer
index (0 based) of the border to be used in this style
57 58 59 |
# File 'lib/axlsx/stylesheet/xf.rb', line 57 def borderId @borderId end |
#fillId ⇒ Integer
index (0 based) of the fill to be used in this style
53 54 55 |
# File 'lib/axlsx/stylesheet/xf.rb', line 53 def fillId @fillId end |
#fontId ⇒ Integer
index (0 based) of the font to be used in this style
49 50 51 |
# File 'lib/axlsx/stylesheet/xf.rb', line 49 def fontId @fontId end |
#numFmtId ⇒ Integer
id of the numFmt to apply to this style
45 46 47 |
# File 'lib/axlsx/stylesheet/xf.rb', line 45 def numFmtId @numFmtId end |
#pivotButton ⇒ Boolean
indicates if the cell has a pivot table drop down button
69 70 71 |
# File 'lib/axlsx/stylesheet/xf.rb', line 69 def pivotButton @pivotButton end |
#protection ⇒ CellProtection
The cell protection for this style
41 42 43 |
# File 'lib/axlsx/stylesheet/xf.rb', line 41 def protection @protection end |
#quotePrefix ⇒ Boolean
indecates if text should be prefixed by a single quote in the cell
65 66 67 |
# File 'lib/axlsx/stylesheet/xf.rb', line 65 def quotePrefix @quotePrefix end |
#xfId ⇒ Integer
index (0 based) of cellStylesXfs item to be used in this style. Only applies to cellXfs items
61 62 63 |
# File 'lib/axlsx/stylesheet/xf.rb', line 61 def xfId @xfId end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the object
135 136 137 138 139 140 141 142 |
# File 'lib/axlsx/stylesheet/xf.rb', line 135 def to_xml_string(str = '') str << '<xf ' serialized_attributes str str << '>' alignment.to_xml_string(str) if self.alignment protection.to_xml_string(str) if self.protection str << '</xf>' end |