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 =
''

Class Method Summary collapse

Methods included from CLI::UI::Frame::FrameStyle

extended, loaded_styles, lookup

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 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

74
75
76
# File 'lib/cli/ui/frame/frame_style/box.rb', line 74

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 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

55
56
57
# File 'lib/cli/ui/frame/frame_style/box.rb', line 55

def divider(text, color:)
  edge(text, color: color, first: DIVIDER)
end

.nameObject


15
16
17
# File 'lib/cli/ui/frame/frame_style/box.rb', line 15

def name
  'box'
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.

Output:

┏━━ Open ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

37
38
39
# File 'lib/cli/ui/frame/frame_style/box.rb', line 37

def open(text, color:)
  edge(text, color: color, first: TOP_LEFT)
end

.prefixObject


19
20
21
# File 'lib/cli/ui/frame/frame_style/box.rb', line 19

def prefix
  VERTICAL
end