Class: Tep::WebSocket::Event
- Inherits:
-
Object
- Object
- Tep::WebSocket::Event
- Defined in:
- lib/tep/websocket/driver.rb
Overview
Event passed to handler callbacks. Holds ‘data` (the payload as String for text/binary, raw bytes for ping/pong, or the close code+reason for close) and a numeric `code` for close.
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#data ⇒ Object
Returns the value of attribute data.
-
#reason ⇒ Object
Returns the value of attribute reason.
Instance Method Summary collapse
-
#initialize ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize ⇒ Event
Returns a new instance of Event.
137 138 139 140 141 |
# File 'lib/tep/websocket/driver.rb', line 137 def initialize @data = "" @code = 0 @reason = "" end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
135 136 137 |
# File 'lib/tep/websocket/driver.rb', line 135 def code @code end |
#data ⇒ Object
Returns the value of attribute data.
135 136 137 |
# File 'lib/tep/websocket/driver.rb', line 135 def data @data end |
#reason ⇒ Object
Returns the value of attribute reason.
135 136 137 |
# File 'lib/tep/websocket/driver.rb', line 135 def reason @reason end |