Class: Axlsx::Dxf
- Inherits:
-
Object
- Object
- Axlsx::Dxf
- Includes:
- OptionsParser
- Defined in:
- lib/axlsx/stylesheet/dxf.rb
Overview
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
Constant Summary collapse
- CHILD_ELEMENTS =
The order in which the child elements is put in the XML seems to be important for Excel
[:font, :numFmt, :fill, :alignment, :border, :protection].freeze
Instance Attribute Summary collapse
-
#alignment ⇒ CellAlignment
The cell alignment for this style.
-
#border ⇒ Border
the border to be used in this style.
-
#fill ⇒ Fill
the child fill to be used in this style.
-
#font ⇒ Font
the child font to be used for this style.
-
#numFmt ⇒ NumFmt
the child NumFmt to be used to this style.
-
#protection ⇒ CellProtection
The cell protection for this style.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Dxf
constructor
Creates a new Xf object.
-
#to_xml_string(str = +'')) ⇒ String
Serializes the object.
Methods included from OptionsParser
Constructor Details
#initialize(options = {}) ⇒ Dxf
Creates a new Xf object
47 48 49 |
# File 'lib/axlsx/stylesheet/dxf.rb', line 47 def initialize( = {}) end |
Instance Attribute Details
#alignment ⇒ CellAlignment
The cell alignment for this style
17 18 19 |
# File 'lib/axlsx/stylesheet/dxf.rb', line 17 def alignment @alignment end |
#border ⇒ Border
the border to be used in this style
38 39 40 |
# File 'lib/axlsx/stylesheet/dxf.rb', line 38 def border @border end |
#fill ⇒ Fill
the child fill to be used in this style
34 35 36 |
# File 'lib/axlsx/stylesheet/dxf.rb', line 34 def fill @fill end |
#font ⇒ Font
the child font to be used for this style
30 31 32 |
# File 'lib/axlsx/stylesheet/dxf.rb', line 30 def font @font end |
#numFmt ⇒ NumFmt
the child NumFmt to be used to this style
26 27 28 |
# File 'lib/axlsx/stylesheet/dxf.rb', line 26 def numFmt @numFmt end |
#protection ⇒ CellProtection
The cell protection for this style
22 23 24 |
# File 'lib/axlsx/stylesheet/dxf.rb', line 22 def protection @protection end |
Instance Method Details
#to_xml_string(str = +'')) ⇒ String
Serializes the object
90 91 92 93 94 95 96 97 98 |
# File 'lib/axlsx/stylesheet/dxf.rb', line 90 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| send(element).to_xml_string(str) if send(element) end str << '</dxf>' end |