Class: Tep::WebSocket::Event

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

Instance Method Summary collapse

Constructor Details

#initializeEvent

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

#codeObject

Returns the value of attribute code.



135
136
137
# File 'lib/tep/websocket/driver.rb', line 135

def code
  @code
end

#dataObject

Returns the value of attribute data.



135
136
137
# File 'lib/tep/websocket/driver.rb', line 135

def data
  @data
end

#reasonObject

Returns the value of attribute reason.



135
136
137
# File 'lib/tep/websocket/driver.rb', line 135

def reason
  @reason
end