Class: IpcAuthpipe::Reader
- Inherits:
-
Object
- Object
- IpcAuthpipe::Reader
- Defined in:
- lib/ipcauthpipe/reader.rb
Overview
Abstracting read operations to substitute them with mocks in our tests and also to give potentially a way to replace STDIN operation with something different - file based, for example
Class Method Summary collapse
-
.getbytes(count) ⇒ Object
Returns exactly count number of bytes waiting on the input.
-
.getline ⇒ Object
Returns next line waiting on the input.
Class Method Details
.getbytes(count) ⇒ Object
Returns exactly count number of bytes waiting on the input
16 17 18 |
# File 'lib/ipcauthpipe/reader.rb', line 16 def self.getbytes(count) STDIN.readbytes(count) end |
.getline ⇒ Object
Returns next line waiting on the input
11 12 13 |
# File 'lib/ipcauthpipe/reader.rb', line 11 def self.getline STDIN.gets("\n") end |