struct
Opal::Border
- Opal::Border
- Struct
- Value
- Object
Overview
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).
Defined in:
opal/style/border.crConstructors
- .ascii : Border
- .double : Border
- .from(style : Symbol | Border | String) : Border
- .hidden : Border
- .new(top : String, bottom : String, left : String, right : String, top_left : String, top_right : String, bottom_left : String, bottom_right : String)
- .none : Border
-
.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
-
.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
-
.pattern(top : String, left : String = "|", corners : String = "+") : Border
Creates a custom repeating pattern border (e.g.
- .rounded : Border
- .single : Border
- .thick : Border
Instance Method Summary
- #active? : Bool
- #bottom : String
- #bottom_left : String
- #bottom_right : String
-
#bottom_segment(length : Int32) : String
Generates a tiled horizontal string for the bottom edge of specified character length
- #left : String
-
#left_char(offset : Int32) : Char
Returns the left border character for a given row offset within the height
- #right : String
-
#right_char(offset : Int32) : Char
Returns the right border character for a given row offset within the height
-
#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
- #top : String
- #top_left : String
- #top_right : String
-
#top_segment(length : Int32) : String
Generates a tiled horizontal string for the top edge of specified character length
Constructor Detail
Creates a custom pattern border with fully specified corners
Creates a custom repeating pattern border with distinct horizontal, vertical, and corner symbols
Creates a custom repeating pattern border (e.g. top: "-+", left: "|", corners: "+")
Instance Method Detail
Generates a tiled horizontal string for the bottom edge of specified character length
Returns the left border character for a given row offset within the height
Returns the right border character for a given row offset within the height
Returns a new border with selected pieces swapped
Generates a tiled horizontal string for the top edge of specified character length