Class: OpenXml::Xlsx::Elements::Border
- Inherits:
-
Object
- Object
- OpenXml::Xlsx::Elements::Border
- Defined in:
- lib/openxml/xlsx/elements/border.rb
Instance Attribute Summary collapse
-
#bottom_component ⇒ Object
readonly
Returns the value of attribute bottom_component.
-
#diagonal_component ⇒ Object
readonly
Returns the value of attribute diagonal_component.
-
#left_component ⇒ Object
readonly
Returns the value of attribute left_component.
-
#right_component ⇒ Object
readonly
Returns the value of attribute right_component.
-
#top_component ⇒ Object
readonly
Returns the value of attribute top_component.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Border
constructor
A new instance of Border.
- #to_xml(xml) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Border
Returns a new instance of Border.
7 8 9 10 11 12 13 |
# File 'lib/openxml/xlsx/elements/border.rb', line 7 def initialize(={}) @left_component = .fetch(:left, BorderComponent.new) @right_component = .fetch(:right, BorderComponent.new) @top_component = .fetch(:top, BorderComponent.new) @bottom_component = .fetch(:bottom, BorderComponent.new) @diagonal_component = .fetch(:diagonal, BorderComponent.new) end |
Instance Attribute Details
#bottom_component ⇒ Object (readonly)
Returns the value of attribute bottom_component.
5 6 7 |
# File 'lib/openxml/xlsx/elements/border.rb', line 5 def bottom_component @bottom_component end |
#diagonal_component ⇒ Object (readonly)
Returns the value of attribute diagonal_component.
5 6 7 |
# File 'lib/openxml/xlsx/elements/border.rb', line 5 def diagonal_component @diagonal_component end |
#left_component ⇒ Object (readonly)
Returns the value of attribute left_component.
5 6 7 |
# File 'lib/openxml/xlsx/elements/border.rb', line 5 def left_component @left_component end |
#right_component ⇒ Object (readonly)
Returns the value of attribute right_component.
5 6 7 |
# File 'lib/openxml/xlsx/elements/border.rb', line 5 def right_component @right_component end |
#top_component ⇒ Object (readonly)
Returns the value of attribute top_component.
5 6 7 |
# File 'lib/openxml/xlsx/elements/border.rb', line 5 def top_component @top_component end |
Instance Method Details
#to_xml(xml) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/openxml/xlsx/elements/border.rb', line 15 def to_xml(xml) xml.border do left_component.to_xml("left", xml) right_component.to_xml("right", xml) top_component.to_xml("top", xml) bottom_component.to_xml("bottom", xml) diagonal_component.to_xml("diagonal", xml) end end |