Class: Uniword::Wordprocessingml::ParagraphBorders
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Uniword::Wordprocessingml::ParagraphBorders
- Defined in:
- lib/uniword/wordprocessingml/paragraph_borders.rb
Overview
Paragraph borders
Generated from OOXML schema: wordprocessingml.yml Element: <w:pBdr>
Class Method Summary collapse
-
.box(style:, color:, size: 6, space: 1) ⇒ ParagraphBorders
Create a box-style border (all four sides with same style).
Instance Method Summary collapse
-
#box? ⇒ Boolean
Check if this is a box-style border (all four sides present with same style).
Class Method Details
.box(style:, color:, size: 6, space: 1) ⇒ ParagraphBorders
Create a box-style border (all four sides with same style)
39 40 41 42 |
# File 'lib/uniword/wordprocessingml/paragraph_borders.rb', line 39 def self.box(style:, color:, size: 6, space: 1) border = Border.new(val: style, color: color, sz: size, space: space) new(top: border, bottom: border, left: border, right: border) end |
Instance Method Details
#box? ⇒ Boolean
Check if this is a box-style border (all four sides present with same style)
47 48 49 50 51 52 53 |
# File 'lib/uniword/wordprocessingml/paragraph_borders.rb', line 47 def box? return false unless top && bottom && left && right return false unless top.val == bottom.val && top.val == left.val && top.val == right.val return false unless top.color == bottom.color && top.color == left.color && top.color == right.color true end |