Class: IpcAuthpipe::Reader

Inherits:
Object
  • Object
show all
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

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

.getlineObject

Returns next line waiting on the input



11
12
13
# File 'lib/ipcauthpipe/reader.rb', line 11

def self.getline
  STDIN.gets("\n")
end