Class: OpenXml::Xlsx::Elements::BorderComponent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#colorObject

Returns the value of attribute color

Returns:

  • (Object)

    the current value of color



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

def color
  @color
end

#styleObject

Returns the value of attribute style

Returns:

  • (Object)

    the current value of style



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

def style
  @style
end

Instance Method Details

#to_xml(name, xml) ⇒ Object



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

def to_xml(name, xml)
  if style && color
    xml.public_send(name, style: style) do
      color.to_xml("color", xml)
    end
  elsif style
    xml.public_send(name, style: style)
  else
    xml.public_send(name)
  end
end