Class: Riddl::WebSocketImplementation
- Inherits:
-
Object
- Object
- Riddl::WebSocketImplementation
show all
- Defined in:
- lib/ruby/riddl/implementation.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of WebSocketImplementation.
65
66
67
68
69
70
71
72
|
# File 'lib/ruby/riddl/implementation.rb', line 65
def initialize(ws)
@ws = ws
@r = ws[:r] @s = ws[:s] @match = ws[:match] @env = ws[:env] @a = ws[:a] end
|
Instance Method Details
#close ⇒ Object
93
94
95
|
# File 'lib/ruby/riddl/implementation.rb', line 93
def close
@ws[:io].close_connection
end
|
#closed? ⇒ Boolean
89
90
91
|
# File 'lib/ruby/riddl/implementation.rb', line 89
def closed?
@ws[:io].closed?
end
|
#io ⇒ Object
86
87
88
|
# File 'lib/ruby/riddl/implementation.rb', line 86
def io
@ws[:io]
end
|
#io=(connection) ⇒ Object
83
84
85
|
# File 'lib/ruby/riddl/implementation.rb', line 83
def io=(connection)
@ws[:io] = connection
end
|
#onclose ⇒ Object
75
|
# File 'lib/ruby/riddl/implementation.rb', line 75
def onclose;end
|
#onerror(err) ⇒ Object
77
|
# File 'lib/ruby/riddl/implementation.rb', line 77
def onerror(err);end
|
#onmessage ⇒ Object
76
|
# File 'lib/ruby/riddl/implementation.rb', line 76
def onmessage;end
|
#onopen ⇒ Object
74
|
# File 'lib/ruby/riddl/implementation.rb', line 74
def onopen;end
|
#send(data) ⇒ Object
79
80
81
|
# File 'lib/ruby/riddl/implementation.rb', line 79
def send(data)
@ws[:io].send data
end
|