Class: OpenXml::Xlsx::Elements::Alignment

Inherits:
Struct
  • Object
show all
Defined in:
lib/openxml/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



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

def horizontal
  @horizontal
end

#indentObject

Returns the value of attribute indent

Returns:

  • (Object)

    the current value of indent



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

def indent
  @indent
end

#verticalObject

Returns the value of attribute vertical

Returns:

  • (Object)

    the current value of vertical



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

def vertical
  @vertical
end

#wrapTextObject

Returns the value of attribute wrapText

Returns:

  • (Object)

    the current value of wrapText



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

def wrapText
  @wrapText
end

Instance Method Details

#attributesObject



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

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



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

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