struct Opal::Border

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.ascii : Border #

[View source]
def self.double : Border #

[View source]
def self.from(style : Symbol | Border | String) : Border #

[View source]
def self.hidden : Border #

[View source]
def self.new(top : String, bottom : String, left : String, right : String, top_left : String, top_right : String, bottom_left : String, bottom_right : String) #

[View source]
def self.none : Border #

[View source]
def self.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


[View source]
def self.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


[View source]
def self.pattern(top : String, left : String = "|", corners : String = "+") : Border #

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


[View source]
def self.rounded : Border #

[View source]
def self.single : Border #

[View source]
def self.thick : Border #

[View source]

Instance Method Detail

def active? : Bool #

[View source]
def bottom : String #

[View source]
def bottom_left : String #

[View source]
def bottom_right : String #

[View source]
def bottom_segment(length : Int32) : String #

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


[View source]
def left : String #

[View source]
def left_char(offset : Int32) : Char #

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


[View source]
def right : String #

[View source]
def right_char(offset : Int32) : Char #

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


[View source]
def 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


[View source]
def top : String #

[View source]
def top_left : String #

[View source]
def top_right : String #

[View source]
def top_segment(length : Int32) : String #

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


[View source]