module RatatuiRuby::Symbols::Line
Box-drawing characters for borders and lines.
Terminal UIs need consistent box-drawing characters for borders and dividers. Memorizing Unicode box-drawing characters is tedious and error-prone.
This module exposes both individual characters and predefined sets. Use the sets with widgets that accept a line_set parameter, or use individual characters for custom drawing.
Examples
# Use a predefined set for drawing boxes line_set = Symbols::Line::ROUNDED # Draw a simple frame top = "#{line_set[:top_left]}#{line_set[:horizontal] * 10}#{line_set[:top_right]}" mid = "#{line_set[:vertical]}#{' ' * 10}#{line_set[:vertical]}" bot = "#{line_set[:bottom_left]}#{line_set[:horizontal] * 10}#{line_set[:bottom_right]}" # Use individual characters for custom drawing corner = Symbols::Line::ROUNDED_TOP_LEFT # => "╭"
Constants
- BOTTOM_LEFT
-
Standard bottom-left corner.
- BOTTOM_RIGHT
-
Standard bottom-right corner.
- CROSS
-
Standard cross (4-way intersection).
- DOUBLE
-
Double-line box-drawing set.
- DOUBLE_BOTTOM_LEFT
-
Double bottom-left corner.
- DOUBLE_BOTTOM_RIGHT
-
Double bottom-right corner.
- DOUBLE_CROSS
-
Double cross (4-way intersection).
- DOUBLE_HORIZONTAL
-
Double horizontal line.
- DOUBLE_HORIZONTAL_DOWN
-
Double T-junction pointing down.
- DOUBLE_HORIZONTAL_UP
-
Double T-junction pointing up.
- DOUBLE_TOP_LEFT
-
Double top-left corner.
- DOUBLE_TOP_RIGHT
-
Double top-right corner.
- DOUBLE_VERTICAL
-
Double vertical line.
- DOUBLE_VERTICAL_LEFT
-
Double T-junction pointing left.
- DOUBLE_VERTICAL_RIGHT
-
Double T-junction pointing right.
- HORIZONTAL
-
Standard horizontal line.
- HORIZONTAL_DOWN
-
Standard T-junction pointing down.
- HORIZONTAL_UP
-
Standard T-junction pointing up.
- NORMAL
-
Standard box-drawing set with straight corners.
- ROUNDED
-
Box-drawing set with rounded corners.
- ROUNDED_BOTTOM_LEFT
-
Rounded bottom-left corner.
- ROUNDED_BOTTOM_RIGHT
-
Rounded bottom-right corner.
- ROUNDED_TOP_LEFT
-
Rounded top-left corner.
- ROUNDED_TOP_RIGHT
-
Rounded top-right corner.
- THICK
-
Thick (heavy) box-drawing set.
- THICK_BOTTOM_LEFT
-
Thick bottom-left corner.
- THICK_BOTTOM_RIGHT
-
Thick bottom-right corner.
- THICK_CROSS
-
Thick cross (4-way intersection).
- THICK_HORIZONTAL
-
Thick (heavy) horizontal line.
- THICK_HORIZONTAL_DOWN
-
Thick T-junction pointing down.
- THICK_HORIZONTAL_UP
-
Thick T-junction pointing up.
- THICK_TOP_LEFT
-
Thick top-left corner.
- THICK_TOP_RIGHT
-
Thick top-right corner.
- THICK_VERTICAL
-
Thick (heavy) vertical line.
- THICK_VERTICAL_LEFT
-
Thick T-junction pointing left.
- THICK_VERTICAL_RIGHT
-
Thick T-junction pointing right.
- TOP_LEFT
-
Standard top-left corner.
- TOP_RIGHT
-
Standard top-right corner.
- VERTICAL
-
Standard vertical line.
- VERTICAL_LEFT
-
Standard T-junction pointing left.
- VERTICAL_RIGHT
-
Standard T-junction pointing right.