Class: Nitrous::ProgressBarAwareStandardOut
- Inherits:
-
Object
- Object
- Nitrous::ProgressBarAwareStandardOut
- Defined in:
- lib/nitrous/progress_bar.rb
Instance Method Summary collapse
- #direct_write(object) ⇒ Object
-
#initialize(stdout, progress_bar) ⇒ ProgressBarAwareStandardOut
constructor
A new instance of ProgressBarAwareStandardOut.
- #print(*args) ⇒ Object
- #puts(*args) ⇒ Object
- #write(object) ⇒ Object
Constructor Details
#initialize(stdout, progress_bar) ⇒ ProgressBarAwareStandardOut
Returns a new instance of ProgressBarAwareStandardOut.
11 12 13 |
# File 'lib/nitrous/progress_bar.rb', line 11 def initialize(stdout, ) @stdout, @progress_bar = stdout, end |
Instance Method Details
#direct_write(object) ⇒ Object
33 34 35 |
# File 'lib/nitrous/progress_bar.rb', line 33 def direct_write(object) @stdout.write(object) end |
#print(*args) ⇒ Object
21 22 23 24 25 |
# File 'lib/nitrous/progress_bar.rb', line 21 def print(*args) args.each do |arg| write(arg) end end |
#puts(*args) ⇒ Object
27 28 29 30 31 |
# File 'lib/nitrous/progress_bar.rb', line 27 def puts(*args) args.each do |arg| write("#{arg}\n") end end |
#write(object) ⇒ Object
15 16 17 18 19 |
# File 'lib/nitrous/progress_bar.rb', line 15 def write(object) @progress_bar. @stdout.write(object) @progress_bar. end |