Class: WebSocketEvent

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#contentObject

Returns the value of attribute content.



13
14
15
# File 'lib/websocketevent.rb', line 13

def content
  @content
end

#typeObject

Returns the value of attribute type.



12
13
14
# File 'lib/websocketevent.rb', line 12

def type
  @type
end