class Axlsx::Dxf
The Dxf
class defines an incremental formatting record for use in Styles
. The recommended way to manage styles for your workbook is with Styles#add_style
@see Styles#add_style
Constants
- CHILD_ELEMENTS
The order in which the child elements is put in the XML seems to be important for Excel
Attributes
The cell alignment for this style @return [CellAlignment] @see CellAlignment
the border to be used in this style @return [Border]
the child fill to be used in this style @return [Fill]
the child font to be used for this style @return [Font]
the child NumFmt
to be used to this style @return [NumFmt]
The cell protection for this style @return [CellProtection] @see CellProtection
Public Class Methods
Creates a new Xf
object @option options [Border] border @option options [NumFmt] numFmt @option options [Fill] fill @option options [Font] font @option options [CellAlignment] alignment @option options [CellProtection] protection
# File lib/axlsx/stylesheet/dxf.rb, line 47 def initialize(options={}) parse_options options end
Public Instance Methods
@see Dxf#alignment
# File lib/axlsx/stylesheet/dxf.rb, line 52 def alignment=(v) DataTypeValidator.validate "Dxf.alignment", CellAlignment, v; @alignment = v end
@see border
# File lib/axlsx/stylesheet/dxf.rb, line 60 def border=(v) DataTypeValidator.validate "Dxf.border", Border, v; @border = v end
@see fill
# File lib/axlsx/stylesheet/dxf.rb, line 62 def fill=(v) DataTypeValidator.validate "Dxf.fill", Fill, v; @fill = v end
@see font
# File lib/axlsx/stylesheet/dxf.rb, line 58 def font=(v) DataTypeValidator.validate "Dxf.font", Font, v; @font = v end
@see numFmt
# File lib/axlsx/stylesheet/dxf.rb, line 56 def numFmt=(v) DataTypeValidator.validate "Dxf.numFmt", NumFmt, v; @numFmt = v end
@see protection
# File lib/axlsx/stylesheet/dxf.rb, line 54 def protection=(v) DataTypeValidator.validate "Dxf.protection", CellProtection, v; @protection = v end
Serializes the object @param [String] str @return [String]
# File lib/axlsx/stylesheet/dxf.rb, line 67 def to_xml_string(str = '') str << '<dxf>' # Dxf elements have no attributes. All of the instance variables # are child elements. CHILD_ELEMENTS.each do |element| self.send(element).to_xml_string(str) if self.send(element) end str << '</dxf>' end