Class: Axlsx::Border
- Inherits:
-
Object
- Object
- Axlsx::Border
- Includes:
- OptionsParser, SerializedAttributes
- Defined in:
- lib/axlsx/stylesheet/border.rb
Overview
This class details a border used in Office Open XML spreadsheet styles.
Constant Summary collapse
- EDGES =
[:left, :right, :top, :bottom].freeze
Instance Attribute Summary collapse
-
#diagonal_down ⇒ Boolean
(also: #diagonalDown)
The diagonal down property for the border that indicates if the border should include a diagonal line from the top left to the top right of the cell.
-
#diagonal_up ⇒ Boolean
(also: #diagonalUp)
The diagonal up property for the border that indicates if the border should include a diagonal line from the bottom left to the top right of the cell.
-
#outline ⇒ Boolean
The outline property for the border indicating that top, left, right and bottom borders should only be applied to the outside border of a range of cells.
-
#prs ⇒ SimpleTypedList
readonly
A list of BorderPr objects for this border.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Border
constructor
Creates a new Border object.
-
#to_xml_string(str = +'')) ⇒ String
Serializes the object.
Methods included from OptionsParser
Methods included from SerializedAttributes
included, #serialized_attributes, #serialized_element_attributes, #serialized_tag
Constructor Details
Instance Attribute Details
#diagonal_down ⇒ Boolean Also known as: diagonalDown
Returns The diagonal down property for the border that indicates if the border should include a diagonal line from the top left to the top right of the cell.
36 37 38 |
# File 'lib/axlsx/stylesheet/border.rb', line 36 def diagonal_down @diagonal_down end |
#diagonal_up ⇒ Boolean Also known as: diagonalUp
Returns The diagonal up property for the border that indicates if the border should include a diagonal line from the bottom left to the top right of the cell.
32 33 34 |
# File 'lib/axlsx/stylesheet/border.rb', line 32 def diagonal_up @diagonal_up end |
#outline ⇒ Boolean
Returns The outline property for the border indicating that top, left, right and bottom borders should only be applied to the outside border of a range of cells.
40 41 42 |
# File 'lib/axlsx/stylesheet/border.rb', line 40 def outline @outline end |
#prs ⇒ SimpleTypedList (readonly)
Returns A list of BorderPr objects for this border.
43 44 45 |
# File 'lib/axlsx/stylesheet/border.rb', line 43 def prs @prs end |
Instance Method Details
#to_xml_string(str = +'')) ⇒ String
Serializes the object
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/axlsx/stylesheet/border.rb', line 68 def to_xml_string(str = +'') str << '<border ' serialized_attributes str str << '>' # enforces order [:start, :end, :left, :right, :top, :bottom, :diagonal, :vertical, :horizontal].each do |k| @prs.select { |pr| pr.name == k }.each do |part| part.to_xml_string(str) end end str << '</border>' end |