lib/angelo/base.rb in angelo-0.1.10 vs lib/angelo/base.rb in angelo-0.1.11

- old
+ new

@@ -84,11 +84,11 @@ routes[m][path] = Responder.new &block end end def websocket path, &block - routes[:socket][path] = WebsocketResponder.new &block + routes[:websocket][path] = WebsocketResponder.new &block end def on_pong &block WebsocketResponder.on_pong = block end @@ -162,9 +162,13 @@ every(@@ping_time) do websockets.all_each do |ws| ws.socket << ::WebSocket::Message.ping.to_data end end + end + + def halt status = 400, body = '' + throw :halt, HALT_STRUCT.new(status, body) end end end