Module: CLI::UI::Frame::FrameStyle::Interface
- Defined in:
- lib/cli/ui/frame/frame_style.rb
Overview
Public interface for FrameStyles Applied by extending FrameStyle
Instance Method Summary collapse
-
#close(text, color:, right_text: nil) ⇒ Object
Draws the “Close” line for this frame style.
-
#divider(text, color: nil) ⇒ Object
Draws a “divider” line for the current frame style.
- #name ⇒ Object
-
#open(text, color:) ⇒ Object
Draws the “Open” line for this frame style.
-
#prefix ⇒ Object
Returns the character(s) that should be printed at the beginning of lines inside this frame.
-
#prefix_width ⇒ Object
Returns the printing width of the prefix.
Instance 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
90 91 92 |
# File 'lib/cli/ui/frame/frame_style.rb', line 90 def close(text, color:, right_text: nil) raise NotImplementedError end |
#divider(text, color: nil) ⇒ 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.
104 105 106 |
# File 'lib/cli/ui/frame/frame_style.rb', line 104 def divider(text, color: nil) raise NotImplementedError end |
#name ⇒ Object
50 51 52 |
# File 'lib/cli/ui/frame/frame_style.rb', line 50 def name raise NotImplementedError end |
#open(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.
75 76 77 |
# File 'lib/cli/ui/frame/frame_style.rb', line 75 def open(text, color:) raise NotImplementedError end |
#prefix ⇒ Object
Returns the character(s) that should be printed at the beginning of lines inside this frame
56 57 58 |
# File 'lib/cli/ui/frame/frame_style.rb', line 56 def prefix raise NotImplementedError end |
#prefix_width ⇒ Object
Returns the printing width of the prefix
61 62 63 |
# File 'lib/cli/ui/frame/frame_style.rb', line 61 def prefix_width CLI::UI::ANSI.printing_width(prefix) end |