SimpleBar

Summary

Functions

This produces the string with a bar of the correct length to be consumed later

Returns the percentage of completed items

Entry method for simple bar. Pass the total size of the items to process. The module always returns the object you pass it in order to make it pipe-able

Increments the bar by a given amount and returns the item it is given

Functions

bar(remaining_per)

Specs

bar(float) :: char_list

This produces the string with a bar of the correct length to be consumed later.

iex> SimpleBar.bar(10) ‘ 10% Done [===========]‘

percent_done(number_done, total)

Specs

percent_done(integer, integer) :: float

Returns the percentage of completed items

Example

iex> SimpleBar.percent_done(1,10) 10.0

start(item_to_return, total)

Specs

start(any, integer) :: any

Entry method for simple bar. Pass the total size of the items to process. The module always returns the object you pass it in order to make it pipe-able.

Example

iex> SimpleBar.start(:ok,100) :ok

step(item_to_return, number_done, total)

Specs

step(any, integer, integer) :: any

Increments the bar by a given amount and returns the item it is given.

Example

iex> SimpleBar.step(:ok, 10,100) :ok