Class: Xlsx::Elements::Alignment

Inherits:
Struct
  • Object
show all
Defined in:
lib/xlsx/elements/alignment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#horizontalObject

Returns the value of attribute horizontal

Returns:

  • (Object)

    the current value of horizontal



3
4
5
# File 'lib/xlsx/elements/alignment.rb', line 3

def horizontal
  @horizontal
end

#indentObject

Returns the value of attribute indent

Returns:

  • (Object)

    the current value of indent



3
4
5
# File 'lib/xlsx/elements/alignment.rb', line 3

def indent
  @indent
end

#verticalObject

Returns the value of attribute vertical

Returns:

  • (Object)

    the current value of vertical



3
4
5
# File 'lib/xlsx/elements/alignment.rb', line 3

def vertical
  @vertical
end

#wrapTextObject

Returns the value of attribute wrapText

Returns:

  • (Object)

    the current value of wrapText



3
4
5
# File 'lib/xlsx/elements/alignment.rb', line 3

def wrapText
  @wrapText
end

Instance Method Details

#attributesObject



5
6
7
8
9
10
11
12
# File 'lib/xlsx/elements/alignment.rb', line 5

def attributes
  {}.tap do |attrs|
    attrs[:horizontal] = horizontal if horizontal
    attrs[:vertical] = vertical if vertical
    attrs[:indent] = indent if indent
    attrs[:wrapText] = wrapText if wrapText
  end
end

#to_xml(xml) ⇒ Object



14
15
16
# File 'lib/xlsx/elements/alignment.rb', line 14

def to_xml(xml)
  xml.alignment(attributes)
end