class

Opal::Prompt::ProgressBar

Inherits Reference < Object

Smooth Unicode progress bar with percentage, counters, and in-place redrawing.

Constants

SUB_BLOCKS = [" ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█"]

Constructors

new(total : Int32, bar_width : Int32 = 30, color : Color | Symbol | String = :cyan, title : String | Nil = nil, driver : Terminal::Driver | Nil = nil)
Source

Class methods

run(total : Int32, bar_width : Int32 = 30, color : Color | Symbol | String = :cyan, title : String | Nil = nil, driver : Terminal::Driver | Nil = nil, &block : ProgressBar -> Nil) : Nil

Yields an active progress bar and renders updates.

Source

Instance methods

advance(step : Int32 = 1) : Nil

Increments current value by step and redraws.

Source
bar_width
Source
bar_width=(bar_width : Int32)
Source
color
Source
color=(color : Color)
Source
current
Source
current=(current : Int32)
Source
finish
Source
percent
Source
render

Renders the progress bar string to the terminal.

Source
set(val : Int32) : Nil

Sets current progress value and redraws.

Source
title
Source
title=(title : String | Nil)
Source
total
Source
total=(total : Int32)
Source