Class: Gerrit::Output
- Inherits:
-
Object
- Object
- Gerrit::Output
- Defined in:
- lib/gerrit/output.rb
Overview
Encapsulates all communication to an output source.
Class Method Summary collapse
-
.silent ⇒ Gerrit::Output
Creates a Output which displays nothing.
Instance Method Summary collapse
-
#initialize(stream) ⇒ Output
constructor
Creates a new Output instance.
-
#print(output) ⇒ Object
Print the specified output.
Constructor Details
#initialize(stream) ⇒ Output
Creates a new Gerrit::Output instance.
14 15 16 |
# File 'lib/gerrit/output.rb', line 14 def initialize(stream) @output_stream = stream end |
Class Method Details
.silent ⇒ Gerrit::Output
Creates a Gerrit::Output which displays nothing.
7 8 9 |
# File 'lib/gerrit/output.rb', line 7 def self.silent new(File.open('/dev/null', 'w')) end |
Instance Method Details
#print(output) ⇒ Object
Print the specified output.
21 22 23 |
# File 'lib/gerrit/output.rb', line 21 def print(output) @output_stream.print(output) end |