Class: Xlsx::Elements::BorderComponent

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



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

def color
  @color
end

#styleObject

Returns the value of attribute style

Returns:

  • (Object)

    the current value of style



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

def style
  @style
end

Instance Method Details

#to_xml(name, xml) ⇒ Object



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

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