module CLI::UI::Frame::FrameStyle::Interface

Public interface for FrameStyles Applied by extending FrameStyle

Public Instance Methods

close(text, color:, right_text: nil) click to toggle source

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

# File lib/cli/ui/frame/frame_style.rb, line 90
def close(text, color:, right_text: nil)
  raise NotImplementedError
end
divider(text, color: nil) click to toggle source

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.

# File lib/cli/ui/frame/frame_style.rb, line 104
def divider(text, color: nil)
  raise NotImplementedError
end
name() click to toggle source
# File lib/cli/ui/frame/frame_style.rb, line 50
def name
  raise NotImplementedError
end
open(text, color:) click to toggle source

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.

# File lib/cli/ui/frame/frame_style.rb, line 75
def open(text, color:)
  raise NotImplementedError
end
prefix() click to toggle source

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

# File lib/cli/ui/frame/frame_style.rb, line 56
def prefix
  raise NotImplementedError
end
prefix_width() click to toggle source

Returns the printing width of the prefix

# File lib/cli/ui/frame/frame_style.rb, line 61
def prefix_width
  CLI::UI::ANSI.printing_width(prefix)
end

Private Instance Methods

print_at_x(x, str) click to toggle source