Class: Gameworks::Servlet::MatchMaker
- Defined in:
- lib/gameworks/servlet/match_maker.rb
Defined Under Namespace
Classes: Promise
Constant Summary collapse
- SEATS =
2
Class Attribute Summary collapse
-
.server ⇒ Object
Returns the value of attribute server.
Class Method Summary collapse
-
.request_game(&blk) ⇒ Object
on the class because I want it persistent.
Instance Method Summary collapse
Methods inherited from Base
#initialize, #method_not_allowed, process
Constructor Details
This class inherits a constructor from Gameworks::Servlet::Base
Class Attribute Details
.server ⇒ Object
Returns the value of attribute server.
21 22 23 |
# File 'lib/gameworks/servlet/match_maker.rb', line 21 def server @server end |
Class Method Details
Instance Method Details
#GET(request) ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/gameworks/servlet/match_maker.rb', line 61 def GET(request) MatchMaker.server ||= @server MatchMaker.request_game do |game| request[:async_cb].call [201, {'Location' => "/#{game.id}"}, []] end [-1, {}, []] end |