Sha256: ed901bc4be890d90bdc01f4f4fa0f724bdac2d32e0648e981a12c605b5d5a630

Contents?: true

Size: 447 Bytes

Versions: 1

Compression:

Stored size: 447 Bytes

Contents

class JPC::Handler
  attr_accessor :token

  def initialize(ws, dispatcher)
    @ws = ws
    @dispatcher = dispatcher
  end

  def ping(params = {})
    "pong #{params}"
  end

  def subscribe(channel)
    @dispatcher.subscribe(@ws, channel)
  end

  def unsubscribe(channel)
    @dispatcher.unsubscribe(@ws, channel)
  end

  private

  def allowed_methods
    procedures + %w(ping subscribe unsubscribe)
  end

  def procedures
    []
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jpc-1.1.0 lib/jpc/handler.rb