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
-
#horizontal ⇒ Symbol
The horizontal alignment of the cell.
-
#indent ⇒ Integer
The amount of indent.
-
#justifyLastLine ⇒ Boolean
Indicate if the last line should be justified.
-
#readingOrder ⇒ Integer
The reading order of the text 0 Context Dependent 1 Left-to-Right 2 Right-to-Left.
-
#relativeIndent ⇒ Integer
The amount of relativeIndent.
-
#shrinkToFit ⇒ Boolean
Indicate if the text should be shrunk to the fit in the cell.
-
#textRotation ⇒ Integer
The textRotation of the cell.
-
#vertical ⇒ Symbol
The vertical alignment of the cell.
-
#wrapText ⇒ Boolean
Indicate if the text of the cell should wrap.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ CellAlignment
constructor
Create a new cell_alignment object.
-
#to_xml(xml) ⇒ String
Serializes the cell alignment.
Constructor Details
#initialize(options = {}) ⇒ CellAlignment
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
#horizontal ⇒ Symbol
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 |
#indent ⇒ Integer
The amount of indent
41 42 43 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 41 def indent @indent end |
#justifyLastLine ⇒ Boolean
Indicate if the last line should be justified.
49 50 51 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 49 def justifyLastLine @justifyLastLine end |
#readingOrder ⇒ Integer
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 |
#relativeIndent ⇒ Integer
The amount of relativeIndent
45 46 47 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 45 def relativeIndent @relativeIndent end |
#shrinkToFit ⇒ Boolean
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 |
#textRotation ⇒ Integer
The textRotation of the cell.
33 34 35 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 33 def textRotation @textRotation end |
#vertical ⇒ Symbol
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 |
#wrapText ⇒ Boolean
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
#to_xml(xml) ⇒ String
Serializes the cell alignment
100 101 102 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 100 def to_xml(xml) xml.alignment(self.instance_values) end |