class RatatuiRuby::LineGauge
Displays a compact, single-line progress bar.
Screen space is precious. Standard block gauges are bulky and consume multiple rows.
This widget compresses the feedback. It draws a progress bar using line characters, fitting perfectly into tight layouts or lists.
Use it when you need to show status without stealing focus or space.
Examples
LineGauge.new( ratio: 0.4, filled_style: Style.new(fg: :blue), unfilled_symbol: "-" )
Attributes
Optional wrapping block.
Style for the completed portion.
Character for filled segments.
Optional label.
Progress ratio from 0.0 to 1.0.
Base style applied to the entire gauge.
Style for the remainder.
Character for empty segments.
Public Class Methods
Source
# File lib/ratatui_ruby/schema/line_gauge.rb, line 65 def initialize(ratio: 0.0, label: nil, style: nil, filled_style: nil, unfilled_style: nil, block: nil, filled_symbol: "█", unfilled_symbol: "░") super( ratio: Float(ratio), label: label, style: style, filled_style: filled_style, unfilled_style: unfilled_style, block: block, filled_symbol: filled_symbol, unfilled_symbol: unfilled_symbol ) end
Creates a new LineGauge.
- ratio
-
Float (0.0 - 1.0).
- label
-
String (optional).
- style
-
Style(optional, base style for the gauge). filled_styleunfilled_style- block
filled_symbol-
String (default:
"█"). unfilled_symbol-
String (default:
"░").
Calls superclass method