class Axlsx::CellAlignment

CellAlignment stores information about the cell alignment of a style Xf Object. @note Using Styles#add_style is the recommended way to manage cell alignment. @see Styles#add_style

Attributes

horizontal[R]

The horizontal alignment of the cell. @note

The horizontal cell alignement style must be one of
 :general
 :left
 :center
 :right
 :fill
 :justify
 :centerContinuous
 :distributed

@return [Symbol]

indent[R]

The amount of indent @return [Integer]

justifyLastLine[R]

Indicate if the last line should be justified. @return [Boolean]

justify_last_line[R]

Indicate if the last line should be justified. @return [Boolean]

readingOrder[R]

The reading order of the text 0 Context Dependent 1 Left-to-Right 2 Right-to-Left @return [Integer]

reading_order[R]

The reading order of the text 0 Context Dependent 1 Left-to-Right 2 Right-to-Left @return [Integer]

relativeIndent[R]

The amount of relativeIndent @return [Integer]

relative_indent[R]

The amount of relativeIndent @return [Integer]

shrinkToFit[R]

Indicate if the text should be shrunk to the fit in the cell. @return [Boolean]

shrink_to_fit[R]

Indicate if the text should be shrunk to the fit in the cell. @return [Boolean]

textRotation[R]

The textRotation of the cell. @return [Integer]

text_rotation[R]

The textRotation of the cell. @return [Integer]

vertical[R]

The vertical alignment of the cell. @note

The vertical cell allingment style must be one of the following:
 :top
 :center
 :bottom
 :justify
 :distributed

@return [Symbol]

wrapText[R]

Indicate if the text of the cell should wrap @return [Boolean]

wrap_text[R]

Indicate if the text of the cell should wrap @return [Boolean]

Public Class Methods

new(options={}) click to toggle source

Create a new cell_alignment object @option options [Symbol] horizontal @option options [Symbol] vertical @option options [Integer] text_rotation @option options [Boolean] wrap_text @option options [Integer] indent @option options [Integer] relative_indent @option options [Boolean] justify_last_line @option options [Boolean] shrink_to_fit @option options [Integer] reading_order

# File lib/axlsx/stylesheet/cell_alignment.rb, line 25
def initialize(options={})
  parse_options options
end

Public Instance Methods

horizontal=(v) click to toggle source

@see horizontal

# File lib/axlsx/stylesheet/cell_alignment.rb, line 94
def horizontal=(v) Axlsx::validate_horizontal_alignment v; @horizontal = v end
indent=(v) click to toggle source

@see indent

# File lib/axlsx/stylesheet/cell_alignment.rb, line 106
def indent=(v) Axlsx::validate_unsigned_int v; @indent = v end
justifyLastLine=(v)
Alias for: justify_last_line=
justify_last_line=(v) click to toggle source

@see justifyLastLine

# File lib/axlsx/stylesheet/cell_alignment.rb, line 113
def justify_last_line=(v) Axlsx::validate_boolean v; @justify_last_line = v end
Also aliased as: justifyLastLine=
readingOrder=(v)
Alias for: reading_order=
reading_order=(v) click to toggle source

@see readingOrder

# File lib/axlsx/stylesheet/cell_alignment.rb, line 121
def reading_order=(v) Axlsx::validate_unsigned_int v; @reading_order = v end
Also aliased as: readingOrder=
relativeIndent=(v)
Alias for: relative_indent=
relative_indent=(v) click to toggle source

@see relativeIndent

# File lib/axlsx/stylesheet/cell_alignment.rb, line 109
def relative_indent=(v) Axlsx::validate_int v; @relative_indent = v end
Also aliased as: relativeIndent=
shrinkToFit=(v)
Alias for: shrink_to_fit=
shrink_to_fit=(v) click to toggle source

@see shrinkToFit

# File lib/axlsx/stylesheet/cell_alignment.rb, line 117
def shrink_to_fit=(v) Axlsx::validate_boolean v; @shrink_to_fit = v end
Also aliased as: shrinkToFit=
textRotation=(v)
Alias for: text_rotation=
text_rotation=(v) click to toggle source

@see textRotation

# File lib/axlsx/stylesheet/cell_alignment.rb, line 98
def text_rotation=(v) Axlsx::validate_unsigned_int v; @text_rotation = v end
Also aliased as: textRotation=
to_xml_string(str = '') click to toggle source

Serializes the object @param [String] str @return [String]

# File lib/axlsx/stylesheet/cell_alignment.rb, line 127
def to_xml_string(str = '')
  str << '<alignment '
  serialized_attributes str
  str << '/>'
end
vertical=(v) click to toggle source

@see vertical

# File lib/axlsx/stylesheet/cell_alignment.rb, line 96
def vertical=(v) Axlsx::validate_vertical_alignment v; @vertical = v end
wrapText=(v)
Alias for: wrap_text=
wrap_text=(v) click to toggle source

@see wrapText

# File lib/axlsx/stylesheet/cell_alignment.rb, line 102
def wrap_text=(v) Axlsx::validate_boolean v; @wrap_text = v end
Also aliased as: wrapText=