class
Opal::Prompt::ProgressBar
- Opal::Prompt::ProgressBar
- Reference
- Object
Overview
Smooth Unicode progress bar with percentage, counters, and in-place redrawing.
Defined in:
opal/prompt/progress.crConstant Summary
-
SUB_BLOCKS =
[" ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█"]
Constructors
Class Method Summary
-
.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.
Instance Method Summary
-
#advance(step : Int32 = 1) : Nil
Increments current value by step and redraws.
- #bar_width : Int32
- #bar_width=(bar_width : Int32)
- #color : Color
- #color=(color : Color)
- #current : Int32
- #current=(current : Int32)
- #finish : Nil
- #percent : Float64
-
#render : Nil
Renders the progress bar string to the terminal.
-
#set(val : Int32) : Nil
Sets current progress value and redraws.
- #title : String | Nil
- #title=(title : String | Nil)
- #total : Int32
- #total=(total : Int32)
Constructor Detail
def self.new(total : Int32, bar_width : Int32 = 30, color : Color | Symbol | String = :cyan, title : String | Nil = nil, driver : Terminal::Driver | Nil = nil)
#
Class Method Detail
def self.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.