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

alignment[R]

The cell alignment for this style @return [CellAlignment] @see CellAlignment

border[R]

the border to be used in this style @return [Border]

fill[R]

the child fill to be used in this style @return [Fill]

font[R]

the child font to be used for this style @return [Font]

numFmt[R]

the child NumFmt to be used to this style @return [NumFmt]

protection[R]

The cell protection for this style @return [CellProtection] @see CellProtection

Public Class Methods

new(options={}) click to toggle source

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

alignment=(v) click to toggle source

@see Dxf#alignment

# File lib/axlsx/stylesheet/dxf.rb, line 52
def alignment=(v) DataTypeValidator.validate "Dxf.alignment", CellAlignment, v; @alignment = v end
border=(v) click to toggle source

@see border

# File lib/axlsx/stylesheet/dxf.rb, line 60
def border=(v) DataTypeValidator.validate "Dxf.border", Border, v; @border = v end
fill=(v) click to toggle source

@see fill

# File lib/axlsx/stylesheet/dxf.rb, line 62
def fill=(v) DataTypeValidator.validate "Dxf.fill", Fill, v; @fill = v end
font=(v) click to toggle source

@see font

# File lib/axlsx/stylesheet/dxf.rb, line 58
def font=(v) DataTypeValidator.validate "Dxf.font", Font, v; @font = v end
numFmt=(v) click to toggle source

@see numFmt

# File lib/axlsx/stylesheet/dxf.rb, line 56
def numFmt=(v) DataTypeValidator.validate "Dxf.numFmt", NumFmt, v; @numFmt = v end
protection=(v) click to toggle source

@see protection

# File lib/axlsx/stylesheet/dxf.rb, line 54
def protection=(v) DataTypeValidator.validate "Dxf.protection", CellProtection, v; @protection = v end
to_xml_string(str = '') click to toggle source

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