lib/jpc/handler.rb in jpc-1.2.1 vs lib/jpc/handler.rb in jpc-1.3.0
- old
+ new
@@ -6,11 +6,11 @@
@ws = ws
@dispatcher = dispatcher
end
def ping(params = {})
- "pong #{params}"
+ "pong #{params.inspect}"
end
def subscribe(channel)
@dispatcher.subscribe(@ws, channel)
end
@@ -19,14 +19,10 @@
@dispatcher.unsubscribe(@ws, channel)
end
private
- def allowed_methods
- procedures + %w(ping subscribe unsubscribe)
- end
-
- def procedures
- []
+ def allowed?(method)
+ %w(ping subscribe unsubscribe).include?(method)
end
end
end