struct Sheen::Border

Overview

The characters that compose a box border:

A Border whose pieces are all empty is a "none" Border.

Meta: Reopened so these methods live outside the record macro block but are still attached to the same struct. Why do this? Because the crystal docs commands' wants_doc parser chokes on method docstring comments under the record macro.

Defined in:

sheen/border.cr:16
sheen/border.cr:31

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.ascii : Border #

An ASCII-only border


[View source]
def self.block : Border #

A fat, solid block border


[View source]
def self.double : Border #

Double-vision. A double-stroke border.


[View source]
def self.hidden : Border #

A border of single-cell spaces, holding a frame layout without strokes.


[View source]
def self.inner_half_block : Border #

A half-block border that sits inside the frame


[View source]
def self.markdown : Border #

A Markdown-table style border. Disable #top and #bottom for an actual valid MD table


[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 = "", middle_left : String = "", middle_right : String = "", middle : String = "", middle_top : String = "", middle_bottom : String = "") #

[View source]
def self.normal : Border #

A standard single-stroke border with square corners


[View source]
def self.outer_half_block : Border #

A half-block border that sits outside the frame


[View source]
def self.rounded : Border #

A single-stroke border with rounded corners.


[View source]
def self.thick : Border #

A heavier, single-stroke thick boi border.


[View source]

Class Method Detail

def self.max_rune_width(piece : String) : Int32 #

Max cell-width of any single grapheme in piece. Returns 0 when piece is empty.


[View source]

Instance Method Detail

def bottom : String #

def bottom_left : String #

def bottom_right : String #

def bottom_size : Int32 #

Cell-width of the bottom edge.


[View source]
def clone #

[View source]
def copy_with(top _top = @top, bottom _bottom = @bottom, left _left = @left, right _right = @right, top_left _top_left = @top_left, top_right _top_right = @top_right, bottom_left _bottom_left = @bottom_left, bottom_right _bottom_right = @bottom_right, middle_left _middle_left = @middle_left, middle_right _middle_right = @middle_right, middle _middle = @middle, middle_top _middle_top = @middle_top, middle_bottom _middle_bottom = @middle_bottom) #

[View source]
def left : String #

def left_size : Int32 #

Cell-width of the left edge.


[View source]
def middle : String #

def middle_bottom : String #

def middle_left : String #

def middle_right : String #

def middle_top : String #

def none? : Bool #

True when no border piece is set. You get a none Border.


[View source]
def right : String #

def right_size : Int32 #

Cell-width of the right edge.


[View source]
def top : String #

def top_left : String #

def top_right : String #

def top_size : Int32 #

Cell-width of the top corner edges. 0 if absent.


[View source]