Class: ProgressBarOutputStream
- Inherits:
-
Object
- Object
- ProgressBarOutputStream
- Defined in:
- lib/progress_bar.rb
Overview
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(mgr) ⇒ ProgressBarOutputStream
constructor
A new instance of ProgressBarOutputStream.
- #print(msg) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(mgr) ⇒ ProgressBarOutputStream
Returns a new instance of ProgressBarOutputStream.
291 292 293 294 |
# File 'lib/progress_bar.rb', line 291 def initialize(mgr) @mgr = mgr @msg = '' end |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
289 290 291 |
# File 'lib/progress_bar.rb', line 289 def title @title end |
Instance Method Details
#flush ⇒ Object
300 301 302 |
# File 'lib/progress_bar.rb', line 300 def flush @mgr.flush end |
#print(msg) ⇒ Object
296 297 298 |
# File 'lib/progress_bar.rb', line 296 def print(msg) @msg = msg end |
#to_s ⇒ Object
304 305 306 |
# File 'lib/progress_bar.rb', line 304 def to_s return @msg.clone.split("\n").join("").split("\r").join("") end |