Class: Progress
- Inherits:
-
Object
- Object
- Progress
- Defined in:
- lib/progress.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize ⇒ Progress
constructor
A new instance of Progress.
- #print_line(line) ⇒ Object
- #update_last_line(last_line) ⇒ Object
Constructor Details
#initialize ⇒ Progress
Returns a new instance of Progress.
5 6 7 |
# File 'lib/progress.rb', line 5 def initialize() @last_line = "" end |
Instance Method Details
#print_line(line) ⇒ Object
15 16 17 18 |
# File 'lib/progress.rb', line 15 def print_line(line) print "\033[M#{line}\n#{@last_line}" $stdout.flush() end |
#update_last_line(last_line) ⇒ Object
9 10 11 12 13 |
# File 'lib/progress.rb', line 9 def update_last_line(last_line) @last_line = last_line print "\033[M#{last_line}" $stdout.flush() end |