class Gorsse::Protocol

Attributes

scope[R]

Public Class Methods

new(scope) click to toggle source
# File lib/gorsse/protocol.rb, line 5
def initialize(scope)
  @scope = scope
end

Public Instance Methods

after_connect(client_id) click to toggle source
# File lib/gorsse/protocol.rb, line 15
def after_connect(client_id)
  # Do nothing. Override in subclasses.
end
eql?(other) click to toggle source
# File lib/gorsse/protocol.rb, line 19
def eql?(other)
  self.class == other.class && self.scope == other.scope
end
signal(entity, target: :all) click to toggle source

Send a message to the client through the Gorsse server.

# File lib/gorsse/protocol.rb, line 10
def signal(entity, target: :all)
  event = Event.new(self, target, entity)
  event.send!
end