Class: Axlsx::CellAlignment
- Inherits:
-
Object
- Object
- Axlsx::CellAlignment
- Defined in:
- lib/axlsx/stylesheet/cell_alignment.rb
Overview
Using Styles#add_style is the recommended way to manage cell alignment.
CellAlignment stores information about the cell alignment of a style Xf Object.
Instance Attribute Summary (collapse)
-
- (Symbol) horizontal
The horizontal alignment of the cell.
-
- (Integer) indent
The amount of indent.
-
- (Boolean) justifyLastLine
Indicate if the last line should be justified.
-
- (Integer) readingOrder
The reading order of the text 0 Context Dependent 1 Left-to-Right 2 Right-to-Left.
-
- (Integer) relativeIndent
The amount of relativeIndent.
-
- (Boolean) shrinkToFit
Indicate if the text should be shrunk to the fit in the cell.
-
- (Integer) textRotation
The textRotation of the cell.
-
- (Symbol) vertical
The vertical alignment of the cell.
-
- (Boolean) wrapText
Indicate if the text of the cell should wrap.
Instance Method Summary (collapse)
-
- (CellAlignment) initialize(options = {})
constructor
Create a new cell_alignment object.
-
- (String) to_xml(xml)
Serializes the cell alignment.
Constructor Details
- (CellAlignment) initialize(options = {})
Create a new cell_alignment object
72 73 74 75 76 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 72 def initialize(={}) .each do |o| self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" end end |
Instance Attribute Details
- (Symbol) horizontal
The horizontal cell alignement style must be one of
:general :left :center :right :fill :justify :centerContinuous :distributed
The horizontal alignment of the cell.
18 19 20 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 18 def horizontal @horizontal end |
- (Integer) indent
The amount of indent
41 42 43 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 41 def indent @indent end |
- (Boolean) justifyLastLine
Indicate if the last line should be justified.
49 50 51 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 49 def justifyLastLine @justifyLastLine end |
- (Integer) readingOrder
The reading order of the text 0 Context Dependent 1 Left-to-Right 2 Right-to-Left
60 61 62 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 60 def readingOrder @readingOrder end |
- (Integer) relativeIndent
The amount of relativeIndent
45 46 47 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 45 def relativeIndent @relativeIndent end |
- (Boolean) shrinkToFit
Indicate if the text should be shrunk to the fit in the cell.
53 54 55 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 53 def shrinkToFit @shrinkToFit end |
- (Integer) textRotation
The textRotation of the cell.
33 34 35 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 33 def textRotation @textRotation end |
- (Symbol) vertical
The vertical cell allingment style must be one of the following:
:top :center :bottom :justify :distributed
The vertical alignment of the cell.
29 30 31 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 29 def vertical @vertical end |
- (Boolean) wrapText
Indicate if the text of the cell should wrap
37 38 39 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 37 def wrapText @wrapText end |
Instance Method Details
- (String) to_xml(xml)
Serializes the cell alignment
91 92 93 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 91 def to_xml(xml) xml.alignment(self.instance_values) end |