Class: Zerg::Support::EventMachine::SendMock
- Inherits:
-
Object
- Object
- Zerg::Support::EventMachine::SendMock
- Defined in:
- lib/zerg_support/event_machine/connection_mocks.rb
Overview
Mocks the sending end of an EventMachine 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(data) ⇒ Object
Constructor Details
#initialize ⇒ SendMock
Returns a new instance of SendMock.
6 7 8 |
# File 'lib/zerg_support/event_machine/connection_mocks.rb', line 6 def initialize @string = '' end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
4 5 6 |
# File 'lib/zerg_support/event_machine/connection_mocks.rb', line 4 def string @string end |
Instance Method Details
#send_data(data) ⇒ Object
10 11 12 |
# File 'lib/zerg_support/event_machine/connection_mocks.rb', line 10 def send_data(data) @string << data end |