Class: ShenmeGUI::FakeSocket
- Inherits:
-
Object
- Object
- ShenmeGUI::FakeSocket
- Defined in:
- lib/shenmegui/core.rb
Overview
FakeSocket把send的内容都记录下来,在WebSocket连接建立时会将这些消息读出,转发到ws上
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
-
#initialize ⇒ FakeSocket
constructor
A new instance of FakeSocket.
- #send(msg) ⇒ Object
Constructor Details
#initialize ⇒ FakeSocket
Returns a new instance of FakeSocket.
11 12 13 |
# File 'lib/shenmegui/core.rb', line 11 def initialize @messages = [] end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
10 11 12 |
# File 'lib/shenmegui/core.rb', line 10 def @messages end |
Instance Method Details
#send(msg) ⇒ Object
14 15 16 |
# File 'lib/shenmegui/core.rb', line 14 def send(msg) @messages << msg end |