class Riddl::WebSocketImplementation

Public Class Methods

new(ws) click to toggle source
# File lib/ruby/riddl/implementation.rb, line 65
def initialize(ws)
  @ws    = ws
  @r     = ws[:r]     # the matching resource path
  @s     = ws[:s]     # the matching resource path schema
  @match = ws[:match] # the path of the branch matching, important for recursive
  @env   = ws[:env]   # environment (all headers)
  @a     = ws[:a]     # args to run command
end

Public Instance Methods

close() click to toggle source
# File lib/ruby/riddl/implementation.rb, line 93
def close
  @ws[:io].close_connection
end
closed?() click to toggle source
# File lib/ruby/riddl/implementation.rb, line 89
def closed?
  @ws[:io].closed?
end
io() click to toggle source
# File lib/ruby/riddl/implementation.rb, line 86
def io
  @ws[:io]
end
io=(connection) click to toggle source
# File lib/ruby/riddl/implementation.rb, line 83
def io=(connection)
  @ws[:io] = connection
end
onclose() click to toggle source
# File lib/ruby/riddl/implementation.rb, line 75
def onclose;end
onerror(err) click to toggle source
# File lib/ruby/riddl/implementation.rb, line 77
def onerror(err);end
onmessage() click to toggle source
# File lib/ruby/riddl/implementation.rb, line 76
def onmessage;end
onopen() click to toggle source
# File lib/ruby/riddl/implementation.rb, line 74
def onopen;end
send(data) click to toggle source
# File lib/ruby/riddl/implementation.rb, line 79
def send(data)
  @ws[:io].send data
end