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

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

Raises:

  • (NotImplementedError)

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.

Raises:

  • (NotImplementedError)

104
105
106
# File 'lib/cli/ui/frame/frame_style.rb', line 104

def divider(text, color: nil)
  raise NotImplementedError
end

#nameObject

Raises:

  • (NotImplementedError)

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.

Raises:

  • (NotImplementedError)

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

def open(text, color:)
  raise NotImplementedError
end

#prefixObject

Returns the character(s) that should be printed at the beginning of lines inside this frame

Raises:

  • (NotImplementedError)

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

def prefix
  raise NotImplementedError
end

#prefix_widthObject

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