class Axlsx::Xf
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
@see Styles#add_style
Attributes
The cell alignment for this style @return [CellAlignment] @see CellAlignment
Indicates if the alignment options should be applied @return [Boolean]
indicates if the borderId should be applied @return [Boolean]
indicates if the fillId should be applied @return [Boolean]
indicates if the fontId should be applied @return [Boolean]
indicates if the numFmtId should be applied @return [Boolean]
Indicates if the protection options should be applied @return [Boolean]
index (0 based) of the border to be used in this style @return [Integer]
index (0 based) of the fill to be used in this style @return [Integer]
index (0 based) of the font to be used in this style @return [Integer]
id of the numFmt to apply to this style @return [Integer]
indicates if the cell has a pivot table drop down button @return [Boolean]
The cell protection for this style @return [CellProtection] @see CellProtection
indecates if text should be prefixed by a single quote in the cell @return [Boolean]
index (0 based) of cellStylesXfs item to be used in this style. Only applies to cellXfs items @return [Integer]
Public Class Methods
Creates a new Xf
object @option options [Integer] numFmtId @option options [Integer] fontId @option options [Integer] fillId @option options [Integer] borderId @option options [Integer] xfId @option options [Boolean] quotePrefix @option options [Boolean] pivotButton @option options [Boolean] applyNumberFormat @option options [Boolean] applyFont @option options [Boolean] applyFill @option options [Boolean] applyBorder @option options [Boolean] applyAlignment @option options [Boolean] applyProtection @option options [CellAlignment] alignment @option options [CellProtection] protection
# File lib/axlsx/stylesheet/xf.rb, line 26 def initialize(options={}) parse_options options end
Public Instance Methods
@see Xf#alignment
# File lib/axlsx/stylesheet/xf.rb, line 97 def alignment=(v) DataTypeValidator.validate "Xf.alignment", CellAlignment, v; @alignment = v end
@see applyAlignment
# File lib/axlsx/stylesheet/xf.rb, line 128 def applyAlignment=(v) Axlsx::validate_boolean v; @applyAlignment = v end
@see applyBorder
# File lib/axlsx/stylesheet/xf.rb, line 125 def applyBorder=(v) Axlsx::validate_boolean v; @applyBorder = v end
@see applyFill
# File lib/axlsx/stylesheet/xf.rb, line 122 def applyFill=(v) Axlsx::validate_boolean v; @applyFill = v end
@see applyFont
# File lib/axlsx/stylesheet/xf.rb, line 120 def applyFont=(v) Axlsx::validate_boolean v; @applyFont = v end
@see applyNumberFormat
# File lib/axlsx/stylesheet/xf.rb, line 118 def applyNumberFormat=(v) Axlsx::validate_boolean v; @applyNumberFormat = v end
@see applyProtection
# File lib/axlsx/stylesheet/xf.rb, line 131 def applyProtection=(v) Axlsx::validate_boolean v; @applyProtection = v end
@see borderId
# File lib/axlsx/stylesheet/xf.rb, line 110 def borderId=(v) Axlsx::validate_unsigned_int v; @borderId = v end
@see fillId
# File lib/axlsx/stylesheet/xf.rb, line 108 def fillId=(v) Axlsx::validate_unsigned_int v; @fillId = v end
@see fontId
# File lib/axlsx/stylesheet/xf.rb, line 106 def fontId=(v) Axlsx::validate_unsigned_int v; @fontId = v end
@see numFmtId
# File lib/axlsx/stylesheet/xf.rb, line 103 def numFmtId=(v) Axlsx::validate_unsigned_int v; @numFmtId = v end
@see pivotButton
# File lib/axlsx/stylesheet/xf.rb, line 116 def pivotButton=(v) Axlsx::validate_boolean v; @pivotButton = v end
@see protection
# File lib/axlsx/stylesheet/xf.rb, line 100 def protection=(v) DataTypeValidator.validate "Xf.protection", CellProtection, v; @protection = v end
@see quotePrefix
# File lib/axlsx/stylesheet/xf.rb, line 114 def quotePrefix=(v) Axlsx::validate_boolean v; @quotePrefix = v end
Serializes the object @param [String] str @return [String]
# File lib/axlsx/stylesheet/xf.rb, line 136 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
@see xfId
# File lib/axlsx/stylesheet/xf.rb, line 112 def xfId=(v) Axlsx::validate_unsigned_int v; @xfId = v end