Class: ProgressBarOutputStream

Inherits:
Object
  • Object
show all
Defined in:
lib/progress_bar.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#titleObject (readonly)

Returns the value of attribute title.



289
290
291
# File 'lib/progress_bar.rb', line 289

def title
  @title
end

Instance Method Details

#flushObject



300
301
302
# File 'lib/progress_bar.rb', line 300

def flush
  @mgr.flush
end


296
297
298
# File 'lib/progress_bar.rb', line 296

def print(msg)
  @msg = msg
end

#to_sObject



304
305
306
# File 'lib/progress_bar.rb', line 304

def to_s
  return @msg.clone.split("\n").join("").split("\r").join("")
end