Class: Axlsx::CellAlignment
- Inherits:
-
Object
- Object
- Axlsx::CellAlignment
- Includes:
- OptionsParser, SerializedAttributes
- 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.
-
#justify_last_line ⇒ Boolean
(also: #justifyLastLine)
Indicate if the last line should be justified.
-
#reading_order ⇒ Integer
(also: #readingOrder)
The reading order of the text 0 Context Dependent 1 Left-to-Right 2 Right-to-Left.
-
#relative_indent ⇒ Integer
(also: #relativeIndent)
The amount of relativeIndent.
-
#shrink_to_fit ⇒ Boolean
(also: #shrinkToFit)
Indicate if the text should be shrunk to the fit in the cell.
-
#text_rotation ⇒ Integer
(also: #textRotation)
The textRotation of the cell.
-
#vertical ⇒ Symbol
The vertical alignment of the cell.
-
#wrap_text ⇒ Boolean
(also: #wrapText)
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_string(str = +'')) ⇒ String
Serializes the object.
Methods included from OptionsParser
Methods included from SerializedAttributes
included, #serialized_attributes, #serialized_element_attributes, #serialized_tag
Constructor Details
#initialize(options = {}) ⇒ CellAlignment
Create a new cell_alignment object
22 23 24 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 22 def initialize( = {}) 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.
38 39 40 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 38 def horizontal @horizontal end |
#indent ⇒ Integer
The amount of indent
63 64 65 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 63 def indent @indent end |
#justify_last_line ⇒ Boolean Also known as: justifyLastLine
Indicate if the last line should be justified.
72 73 74 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 72 def justify_last_line @justify_last_line end |
#reading_order ⇒ Integer Also known as: readingOrder
The reading order of the text 0 Context Dependent 1 Left-to-Right 2 Right-to-Left
85 86 87 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 85 def reading_order @reading_order end |
#relative_indent ⇒ Integer Also known as: relativeIndent
The amount of relativeIndent
67 68 69 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 67 def relative_indent @relative_indent end |
#shrink_to_fit ⇒ Boolean Also known as: shrinkToFit
Indicate if the text should be shrunk to the fit in the cell.
77 78 79 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 77 def shrink_to_fit @shrink_to_fit end |
#text_rotation ⇒ Integer Also known as: textRotation
The textRotation of the cell.
53 54 55 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 53 def text_rotation @text_rotation 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.
49 50 51 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 49 def vertical @vertical end |
#wrap_text ⇒ Boolean Also known as: wrapText
Indicate if the text of the cell should wrap
58 59 60 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 58 def wrap_text @wrap_text end |
Instance Method Details
#to_xml_string(str = +'')) ⇒ String
Serializes the object
151 152 153 |
# File 'lib/axlsx/stylesheet/cell_alignment.rb', line 151 def to_xml_string(str = +'') serialized_tag('alignment', str) end |