Class: Sappho::Socket::MockSocket
- Inherits:
-
Object
- Object
- Sappho::Socket::MockSocket
- Defined in:
- lib/sappho-socket/mock_socket.rb
Class Method Summary collapse
Instance Method Summary collapse
- #attach(socket) ⇒ Object
- #close ⇒ Object
- #open(host, port) ⇒ Object
- #read(bytesNeeded) ⇒ Object
- #settle(seconds) ⇒ Object
- #write(str) ⇒ Object
Class Method Details
.session(session) ⇒ Object
11 12 13 |
# File 'lib/sappho-socket/mock_socket.rb', line 11 def MockSocket.session session @@session = session end |
Instance Method Details
#attach(socket) ⇒ Object
15 16 17 |
# File 'lib/sappho-socket/mock_socket.rb', line 15 def attach socket @@session.action :attach, socket end |
#close ⇒ Object
35 36 37 |
# File 'lib/sappho-socket/mock_socket.rb', line 35 def close @@session.action :close end |
#open(host, port) ⇒ Object
19 20 21 |
# File 'lib/sappho-socket/mock_socket.rb', line 19 def open host, port @@session.action :open, host, port end |
#read(bytesNeeded) ⇒ Object
23 24 25 |
# File 'lib/sappho-socket/mock_socket.rb', line 23 def read bytesNeeded @@session.action :read, bytesNeeded end |
#settle(seconds) ⇒ Object
31 32 33 |
# File 'lib/sappho-socket/mock_socket.rb', line 31 def settle seconds @@session.action :settle, seconds end |
#write(str) ⇒ Object
27 28 29 |
# File 'lib/sappho-socket/mock_socket.rb', line 27 def write str @@session.action :write, str end |