Class: HighLine::Test::Driver
- Inherits:
-
Object
- Object
- HighLine::Test::Driver
- Defined in:
- lib/highline/test/driver.rb
Instance Attribute Summary collapse
-
#input_stream ⇒ Object
readonly
Returns the value of attribute input_stream.
-
#output_stream ⇒ Object
readonly
Returns the value of attribute output_stream.
Instance Method Summary collapse
-
#high_line ⇒ Object
Creates and returns a HighLine instance, set up to use the supplied streams.
-
#initialize(input_stream, output_stream) ⇒ Driver
constructor
A new instance of Driver.
-
#inject(text) ⇒ Object
Adds text to the output stream.
Constructor Details
#initialize(input_stream, output_stream) ⇒ Driver
Returns a new instance of Driver.
8 9 10 11 |
# File 'lib/highline/test/driver.rb', line 8 def initialize(input_stream, output_stream) @input_stream = input_stream @output_stream = output_stream end |
Instance Attribute Details
#input_stream ⇒ Object (readonly)
Returns the value of attribute input_stream.
5 6 7 |
# File 'lib/highline/test/driver.rb', line 5 def input_stream @input_stream end |
#output_stream ⇒ Object (readonly)
Returns the value of attribute output_stream.
6 7 8 |
# File 'lib/highline/test/driver.rb', line 6 def output_stream @output_stream end |
Instance Method Details
#high_line ⇒ Object
Creates and returns a HighLine instance, set up to use the supplied streams
14 15 16 17 18 |
# File 'lib/highline/test/driver.rb', line 14 def high_line return @high_line if @high_line HighLine.track_eof = false @high_line = HighLine.new(input_stream, output_stream) end |
#inject(text) ⇒ Object
Adds text to the output stream
21 22 23 |
# File 'lib/highline/test/driver.rb', line 21 def inject(text) @output_stream << text end |