Class: Uniword::TableBorder

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/uniword/table_border.rb

Overview

Represents a table border configuration Used for table and cell borders

Constant Summary collapse

STYLES =

Valid border styles

%w[
  none
  single
  thick
  double
  dotted
  dashed
  dotDash
  dotDotDash
  triple
  thinThickSmallGap
  thickThinSmallGap
  thinThickThinSmallGap
  thinThickMediumGap
  thickThinMediumGap
  thinThickThinMediumGap
  thinThickLargeGap
  thickThinLargeGap
  thinThickThinLargeGap
  wave
  doubleWave
  dashSmallGap
  dashDotStroked
  threeDEmboss
  threeDEngrave
  outset
  inset
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**attributes) ⇒ TableBorder

Returns a new instance of TableBorder.



44
45
46
47
# File 'lib/uniword/table_border.rb', line 44

def initialize(**attributes)
  super
  validate_style
end

Class Method Details

.dashed(width: 4, color: "auto") ⇒ Object

Create a dashed border



60
61
62
# File 'lib/uniword/table_border.rb', line 60

def self.dashed(width: 4, color: "auto")
  new(style: "dashed", width: width, color: color)
end

.dotted(width: 4, color: "auto") ⇒ Object

Create a dotted border



65
66
67
# File 'lib/uniword/table_border.rb', line 65

def self.dotted(width: 4, color: "auto")
  new(style: "dotted", width: width, color: color)
end

.double(width: 6, color: "auto") ⇒ Object

Create a double border



55
56
57
# File 'lib/uniword/table_border.rb', line 55

def self.double(width: 6, color: "auto")
  new(style: "double", width: width, color: color)
end

.noneObject

Create no border



75
76
77
# File 'lib/uniword/table_border.rb', line 75

def self.none
  new(style: "none", width: 0, color: "auto")
end

.single(width: 4, color: "auto") ⇒ Object

Create a simple single border



50
51
52
# File 'lib/uniword/table_border.rb', line 50

def self.single(width: 4, color: "auto")
  new(style: "single", width: width, color: color)
end

.thick(color: "auto") ⇒ Object

Create a thick border



70
71
72
# File 'lib/uniword/table_border.rb', line 70

def self.thick(color: "auto")
  new(style: "thick", width: 8, color: color)
end