Class: IndexUtil::Progress
- Inherits:
-
Object
- Object
- IndexUtil::Progress
- Defined in:
- lib/index_util/progress.rb
Instance Method Summary collapse
- #finish(message) ⇒ Object
-
#initialize(io = $stderr, width: 24) ⇒ Progress
constructor
A new instance of Progress.
- #step(message, current: nil, total: nil, detail: nil) ⇒ Object
Constructor Details
#initialize(io = $stderr, width: 24) ⇒ Progress
Returns a new instance of Progress.
5 6 7 8 9 |
# File 'lib/index_util/progress.rb', line 5 def initialize(io = $stderr, width: 24) @io = io @width = width @last_length = 0 end |
Instance Method Details
#finish(message) ⇒ Object
15 16 17 18 19 |
# File 'lib/index_util/progress.rb', line 15 def finish() write() @io.puts @last_length = 0 end |
#step(message, current: nil, total: nil, detail: nil) ⇒ Object
11 12 13 |
# File 'lib/index_util/progress.rb', line 11 def step(, current: nil, total: nil, detail: nil) write(format_line(, current: current, total: total, detail: detail)) end |