class HqTrivia::Connection::Hq
- HqTrivia::Connection::Hq
- Reference
- Object
Overview
A connection that connects to the current shows websocket and streams messages to the bot.
Included Modules
Defined in:
hqtrivia/connection/hq.crConstructors
Instance Method Summary
-
#connect(coordinator : Coordinator)
Connects to the HQ websocket
-
#open? : Bool
Returns true if the connection is open, false otherwise
-
#ping
Pings the connection with the optional message
-
#run
Starts the connection, you must call #connect first
-
#send_message(message : String)
Sends the message to the connection, raises if the connection is not open
Instance methods inherited from module HqTrivia::Connection::Interface
connect(coordinator : Coordinator)
connect,
on_client_ping(&block : String -> )
on_client_ping,
on_message(&block : HqTrivia::Model::WebSocketMessage -> )
on_message,
on_raw_message(&block : String -> )
on_raw_message,
on_server_pong(&block : String -> )
on_server_pong,
open?
open?,
run
run,
send_message(message : String)
send_message
Constructor Detail
Instance Method Detail
def send_message(message : String)
#
Sends the message to the connection, raises if the connection is not open