struct

Opal::Border

Inherits Struct < Value < Object

Border glyph definitions for boxes, cards, windows, and tables. Supports standard line styles, character swaps, and repeating multi-character pattern borders (e.g. "-+-+-+", "=~=~=", or custom corners).

Constructors

ascii
Source
double
Source
from(style : Symbol | Border | String) : Border
Source
hidden
Source
new(top : String, bottom : String, left : String, right : String, top_left : String, top_right : String, bottom_left : String, bottom_right : String)
Source
none
Source
pattern(top : String, bottom : String, left : String, right : String, top_left : String, top_right : String, bottom_left : String, bottom_right : String) : Border

Creates a custom pattern border with fully specified corners

Source
pattern(top : String, bottom : String, left : String, right : String, corners : String) : Border

Creates a custom repeating pattern border with distinct horizontal, vertical, and corner symbols

Source
pattern(top : String, left : String = "|", corners : String = "+") : Border

Creates a custom repeating pattern border (e.g. top: "-+", left: "|", corners: "+")

Source
rounded
Source
single
Source
thick
Source

Instance methods

active?
Source
bottom
Source
bottom_left
Source
bottom_right
Source
bottom_segment(length : Int32) : String

Generates a tiled horizontal string for the bottom edge of specified character length

Source
left
Source
left_char(offset : Int32) : Char

Returns the left border character for a given row offset within the height

Source
right
Source
right_char(offset : Int32) : Char

Returns the right border character for a given row offset within the height

Source
swap(top : String | Nil = nil, bottom : String | Nil = nil, left : String | Nil = nil, right : String | Nil = nil, corners : String | Nil = nil, top_left : String | Nil = nil, top_right : String | Nil = nil, bottom_left : String | Nil = nil, bottom_right : String | Nil = nil) : Border

Returns a new border with selected pieces swapped

Source
top_left
Source
top_right
Source
top_segment(length : Int32) : String

Generates a tiled horizontal string for the top edge of specified character length

Source