Class: Uniword::ParagraphBorders
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Uniword::ParagraphBorders
- Defined in:
- lib/uniword/paragraph_border.rb
Overview
Represents paragraph borders
Paragraph borders can be applied to individual sides or between paragraphs.
Instance Attribute Summary collapse
-
#between ⇒ ParagraphBorderSide
Border between paragraphs.
-
#bottom ⇒ ParagraphBorderSide
Bottom border.
-
#left ⇒ ParagraphBorderSide
Left border.
-
#right ⇒ ParagraphBorderSide
Right border.
-
#top ⇒ ParagraphBorderSide
Top border.
Class Method Summary collapse
-
.all_sides(style: "single", color: "auto", size: 6, space: 1) ⇒ ParagraphBorders
Create borders on all sides with same properties.
-
.box(style: "single", color: "auto", size: 6, space: 1) ⇒ ParagraphBorders
Create box borders (all sides, no between).
Instance Method Summary collapse
-
#any? ⇒ Boolean
Check if any border is defined.
-
#box? ⇒ Boolean
Check if this creates a complete box.
Instance Attribute Details
#between ⇒ ParagraphBorderSide
Border between paragraphs
60 61 62 |
# File 'lib/uniword/paragraph_border.rb', line 60 def between @between end |
#bottom ⇒ ParagraphBorderSide
Bottom border
60 61 62 |
# File 'lib/uniword/paragraph_border.rb', line 60 def bottom @bottom end |
#left ⇒ ParagraphBorderSide
Left border
60 61 62 |
# File 'lib/uniword/paragraph_border.rb', line 60 def left @left end |
#right ⇒ ParagraphBorderSide
Right border
60 61 62 |
# File 'lib/uniword/paragraph_border.rb', line 60 def right @right end |
#top ⇒ ParagraphBorderSide
Top border
60 61 62 |
# File 'lib/uniword/paragraph_border.rb', line 60 def top @top end |
Class Method Details
.all_sides(style: "single", color: "auto", size: 6, space: 1) ⇒ ParagraphBorders
Create borders on all sides with same properties
74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/uniword/paragraph_border.rb', line 74 def self.all_sides(style: "single", color: "auto", size: 6, space: 1) border_side = ParagraphBorderSide.new( style: style, color: color, size: size, space: space, ) new( top: border_side, bottom: border_side, left: border_side, right: border_side, ) end |
.box(style: "single", color: "auto", size: 6, space: 1) ⇒ ParagraphBorders
Create box borders (all sides, no between)
96 97 98 |
# File 'lib/uniword/paragraph_border.rb', line 96 def self.box(style: "single", color: "auto", size: 6, space: 1) all_sides(style: style, color: color, size: size, space: space) end |
Instance Method Details
#any? ⇒ Boolean
Check if any border is defined
103 104 105 |
# File 'lib/uniword/paragraph_border.rb', line 103 def any? !top.nil? || !bottom.nil? || !left.nil? || !right.nil? || !between.nil? end |
#box? ⇒ Boolean
Check if this creates a complete box
110 111 112 |
# File 'lib/uniword/paragraph_border.rb', line 110 def box? !top.nil? && !bottom.nil? && !left.nil? && !right.nil? end |