Module: CLI::UI::Frame::FrameStyle::Box
- Extended by:
- CLI::UI::Frame::FrameStyle
- Defined in:
- lib/cli/ui/frame/frame_style/box.rb
Constant Summary collapse
- VERTICAL =
'┃'- HORIZONTAL =
'━'- DIVIDER =
'┣'- TOP_LEFT =
'┏'- BOTTOM_LEFT =
'┗'
Constants included from CLI::UI::Frame::FrameStyle
Class Method Summary collapse
-
.close(text, color:, right_text: nil) ⇒ Object
Draws the “Close” line for this frame style.
-
.divider(text, color:) ⇒ Object
Draws a “divider” line for the current frame style.
-
.prefix ⇒ Object
: -> String.
-
.start(text, color:) ⇒ Object
Draws the “Open” line for this frame style.
-
.style_name ⇒ Object
: -> Symbol.
Methods included from CLI::UI::Frame::FrameStyle
close, divider, lookup, prefix, prefix_width, print_at_x, start, style_name
Class Method Details
.close(text, color:, right_text: nil) ⇒ Object
Draws the “Close” line for this frame style
Attributes
-
text- (required) the text/title to output in the frame
Options
-
:color- (required) The color of the frame. -
:right_text- Text to print at the right of the line. Defaults to nil
Output:
┗━━ Close ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
: (String text, color: CLI::UI::Color, ?right_text: String?) -> String
87 88 89 |
# File 'lib/cli/ui/frame/frame_style/box.rb', line 87 def close(text, color:, right_text: nil) edge(text, color: color, right_text: right_text, first: BOTTOM_LEFT) end |
.divider(text, color:) ⇒ Object
Draws a “divider” line for the current frame style
Attributes
-
text- (required) the text/title to output in the frame
Options
-
:color- (required) The color of the frame.
Output:
┣━━ Divider ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
: (String text, color: CLI::UI::Color) -> String
66 67 68 |
# File 'lib/cli/ui/frame/frame_style/box.rb', line 66 def divider(text, color:) edge(text, color: color, first: DIVIDER) end |
.prefix ⇒ Object
: -> String
26 27 28 |
# File 'lib/cli/ui/frame/frame_style/box.rb', line 26 def prefix VERTICAL end |
.start(text, color:) ⇒ Object
Draws the “Open” line for this frame style
Attributes
-
text- (required) the text/title to output in the frame
Options
-
:color- (required) The color of the frame.
Output:
┏━━ Open ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
: (String text, color: CLI::UI::Color) -> String
46 47 48 |
# File 'lib/cli/ui/frame/frame_style/box.rb', line 46 def start(text, color:) edge(text, color: color, first: TOP_LEFT) end |
.style_name ⇒ Object
: -> Symbol
20 21 22 |
# File 'lib/cli/ui/frame/frame_style/box.rb', line 20 def style_name :box end |