Class: Zerg::Support::Sockets::SendMock
- Inherits:
-
Object
- Object
- Zerg::Support::Sockets::SendMock
- Defined in:
- lib/zerg_support/sockets/socket_mocks.rb
Overview
Mocks the sending end of a Socket connection. The sent data is concatenated in a string available by calling #string.
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize ⇒ SendMock
constructor
A new instance of SendMock.
- #send(data, flags) ⇒ Object
Constructor Details
#initialize ⇒ SendMock
Returns a new instance of SendMock.
9 10 11 |
# File 'lib/zerg_support/sockets/socket_mocks.rb', line 9 def initialize @string = '' end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
7 8 9 |
# File 'lib/zerg_support/sockets/socket_mocks.rb', line 7 def string @string end |
Instance Method Details
#send(data, flags) ⇒ Object
13 14 15 |
# File 'lib/zerg_support/sockets/socket_mocks.rb', line 13 def send(data, flags) @string << data end |