Class: Farcall::DebugSocketStream
- Inherits:
-
SocketStream
- Object
- SocketStream
- Farcall::DebugSocketStream
- Defined in:
- lib/farcall/json_transport.rb
Overview
The socket stream that imitates slow data reception over the slow internet connection use to for testing only
Instance Method Summary collapse
-
#initialize(socket, timeout) ⇒ DebugSocketStream
constructor
A new instance of DebugSocketStream.
- #write(data) ⇒ Object
Methods inherited from SocketStream
Constructor Details
#initialize(socket, timeout) ⇒ DebugSocketStream
Returns a new instance of DebugSocketStream.
41 42 43 44 |
# File 'lib/farcall/json_transport.rb', line 41 def initialize socket, timeout super socket @timeout = timeout end |
Instance Method Details
#write(data) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/farcall/json_transport.rb', line 46 def write data data.to_s.each_char { |x| super x sleep @timeout } end |