Class: WebSocketEvent
- Inherits:
-
Object
- Object
- WebSocketEvent
- Defined in:
- lib/websocketevent.rb
Overview
The WebSocketEvent class represents WebSocket event information that is used with the GRIP WebSocket-over-HTTP protocol. It includes information about the type of event as well as an optional content field.
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, content = nil) ⇒ WebSocketEvent
constructor
Initialize with a specified event type and optional content information.
Constructor Details
#initialize(type, content = nil) ⇒ WebSocketEvent
Initialize with a specified event type and optional content information.
16 17 18 19 |
# File 'lib/websocketevent.rb', line 16 def initialize(type, content=nil) @type = type @content = content end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
13 14 15 |
# File 'lib/websocketevent.rb', line 13 def content @content end |
#type ⇒ Object
Returns the value of attribute type.
12 13 14 |
# File 'lib/websocketevent.rb', line 12 def type @type end |