class RemiLib::Console::ProgressBar

Defined in:

remilib/console/progress-bar.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(label : String, max : Int, output : IO = STDOUT) #

[View source]

Instance Method Detail

def label=(newLabel : String) #

Changes the label of the progress bar.


[View source]
def labelWidth : UInt64 #

The maximum width for the progress bar label. If this is 0, then the max width is computed to be 1/5th of the width of the console.


[View source]
def labelWidth=(value : Int) #

Changes the label width. This cannot be negative.


[View source]
def max : UInt64 #

The max number of steps.


[View source]
def max=(newMax : Int) #

Changes the maximum value of the progress bar. This cannot be zero or negative.

If the new maximum is greater than the current #step, then the current #step is set to the new maximum.


[View source]
def pump #

Increases the step by one, then refreshes the bar.


[View source]
def refresh #

Re-prints the progress bar.


[View source]
def step : UInt64 #

The current step


[View source]
def step=(val : Int) #

Sets the step to val, then refreshes the bar. val cannot be less than zero. If it is greater than #max, then it is clamped to #max.


[View source]