Class: HighLine::Test::PartialReader
- Inherits:
-
Object
- Object
- HighLine::Test::PartialReader
- Defined in:
- lib/highline/test/partial_reader.rb
Overview
Wraps a pipe, supplying a non-blocking #gets method
Instance Attribute Summary collapse
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
- #gets ⇒ Object
-
#initialize(stream) ⇒ PartialReader
constructor
A new instance of PartialReader.
Constructor Details
#initialize(stream) ⇒ PartialReader
Returns a new instance of PartialReader.
6 7 8 |
# File 'lib/highline/test/partial_reader.rb', line 6 def initialize(stream) @stream = stream end |
Instance Attribute Details
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
4 5 6 |
# File 'lib/highline/test/partial_reader.rb', line 4 def stream @stream end |
Instance Method Details
#gets ⇒ Object
10 11 12 |
# File 'lib/highline/test/partial_reader.rb', line 10 def gets stream.readpartial(PIPE_BUFFER_SIZE) end |